././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1769180459.0
pyreadstat-1.3.3/ 0000755 0000765 0000024 00000000000 15134706453 012246 5 ustar 00 dialout ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1721316780.0
pyreadstat-1.3.3/LICENSE 0000644 0000765 0000024 00000031147 14646232654 013265 0 ustar 00 dialout The pyreadstat package as a whole is distributed under Apache License
Vesrion 2 (see below).
The pyreadstat package also includes the following open source software
components:
- ReadStat; https://github.com/WizardMac/ReadStat, distributed under MIT license
ReadStat license:
---------------------------------------------------------------------------
Copyright (c) 2013-2016 Evan Miller (except where otherwise noted)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
pyreadstat liscence:
---------------------------------------------------------------------------
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1721316780.0
pyreadstat-1.3.3/MANIFEST.in 0000644 0000765 0000024 00000000252 14646232654 014007 0 ustar 00 dialout include *.h
recursive-include src *.h
recursive-include pyreadstat *.h
include *.pyx
recursive-include pyreadstat *.pyx
include *.pxd
recursive-include pyreadstat *.pxd
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1769180459.0
pyreadstat-1.3.3/PKG-INFO 0000644 0000765 0000024 00000002340 15134706453 013342 0 ustar 00 dialout Metadata-Version: 2.4
Name: pyreadstat
Version: 1.3.3
Summary: Reads and Writes SAS, SPSS and Stata files into/from pandas and polars data frames.
Home-page: https://github.com/Roche/pyreadstat
Download-URL: https://github.com/Roche/pyreadstat/dist
Author: Otto Fajardo
Author-email: pleasecontactviagithub@notvalid.com
License: Apache-2.0
Classifier: Programming Language :: Python
Classifier: Programming Language :: Cython
Classifier: Programming Language :: C
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering
Classifier: Environment :: Console
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: narwhals>=2.10.1
Requires-Dist: numpy
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: download-url
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary
A Python package to read and write SAS
(sas7bdat, sas7bcat, xport/xpt), SPSS (sav, zsav, por) and Stata (dta) files into/from pandas and polars data frames. It is a wrapper
around the C library readstat.
Please visit out project home page for more information:
https://github.com/Roche/pyreadstat
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1769179331.0
pyreadstat-1.3.3/README.md 0000644 0000765 0000024 00000126066 15134704303 013530 0 ustar 00 dialout # pyreadstat
A python package to read and write sas (sas7bdat, sas7bcat, xport), spps (sav, zsav, por) and stata (dta) data files
into/from pandas and polars dataframes.
This module is a wrapper around the excellent [Readstat](https://github.com/WizardMac/ReadStat) C library by
[Evan Miller](https://www.evanmiller.org/). Readstat is the library used in the back of the R library
[Haven](https://github.com/tidyverse/haven),
meaning pyreadstat is a python equivalent to R Haven.
Detailed documentation on all available methods is in the
[Module documentation](https://ofajardo.github.io/pyreadstat_documentation/_build/html/index.html)
If you would like to read R RData and Rds files into python in an easy way,
take a look to [pyreadr](https://github.com/ofajardo/pyreadr), a wrapper
around the C library [librdata](https://github.com/WizardMac/librdata)
If you would like to effortlessly produce beautiful summaries from pandas dataframes take
a look to [pysummaries](https://github.com/Genentech/pysummaries)!
**DISCLAIMER**
**Pyreadstat is not a validated package. The results may have inaccuracies deriving from the fact most of the data formats
are not open. Do not use it for critical tasks such as reporting to the authorities. Pyreadstat is not meant to replace
the original applications in this regard.**
## Table of Contents
* [Motivation](#motivation)
* [Dependencies](#dependencies)
* [Installation](#installation)
+ [Using pip](#using-pip)
+ [Using conda](#using-conda)
+ [From the latest sources](#from-the-latest-sources)
+ [Compiling on Windows and Mac](#compiling-on-windows-and-mac)
* [Usage](#usage)
+ [Basic Usage](#basic-usage)
- [Reading Files](#reading-files)
- [Writing Files](#writing-files)
+ [More reading options](#more-reading-options)
- [Reading only the headers](#reading-only-the-headers)
- [Reading selected columns](#reading-selected-columns)
- [Reading files in parallel processes](#reading-files-in-parallel-processes)
- [Reading rows in chunks](#reading-rows-in-chunks)
- [Reading value labels](#reading-value-labels)
- [Missing Values](#missing-values)
+ [SPSS](#spss)
+ [SAS and STATA](#sas-and-stata)
- [Reading datetime and date columns](#reading-datetime-and-date-columns)
- [Reading from file-like objects](#reading-from-file-like-objects)
- [Other options](#other-options)
+ [More writing options](#more-writing-options)
- [File specific options](#file-specific-options)
- [Writing value labels](#writing-value-labels)
- [Writing user defined missing values](#writing-user-defined-missing-values)
- [Setting variable formats](#setting-variable-formats)
- [Variable type conversion](#variable-type-conversion)
* [Roadmap](#roadmap)
* [CD/CI and wheels](#cdci_and_wheels)
* [Known limitations](#known-limitations)
* [Python 2.7 support.](#python-27-support)
* [Change log](#change-log)
* [License](#license)
* [Contributing](#contributing)
* [People](#people)
## Motivation
The original motivation came from reading sas7bdat files in python. That is already possible using either the (pure
python) package [sas7bdat](https://pypi.org/project/sas7bdat/) or the (cythonized) method
[read_sas](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_sas.html)
from pandas. However, those methods are slow (important if you want to read several large files), do not give the
possibility to recover value labels (stored in
the file itself in the case of spss or stata, or in catalog files in sas), convert both dates and datetime variables to datetime,
and you have to specify the encoding otherwise in python 3 instead of strings you get bytes.
This package corrects those problems.
**1. Good Performance:** Here a comparison of reading a 190 Mb sas7dat file having 202 K rows
by 70 columns with numeric, character and date-like columns using different methods. As you can see
pyreadstat is the fastest for python and matches the speeds of R Haven.
| Method | time |
| :----- | :-----------------: |
| Python 3 - sas7bdat | 6 min |
| Python 3- pandas | 42 s |
| Python 3- pyreadstat | 7 s |
| R - Haven | 7 s |
**2. Reading Value Labels** Neither sas7bdat and pandas.read_sas gives the possibility to read sas7bcat catalog files.
Pyreadstat can do that and also extract value labels from SPSS and STATA files.
**3. Reading dates and datetimes** sas7bdat and pandas.read_sas convert both date and datetime variables into datetime.
That means if you have a date such a '01-01-2018' it will be transformed to '01-01-2018 00:00:00' (it always inserts a
time), making it impossible
to know looking only at the data if the variable was originally a datetime (if it had a time) or not.
Pyreadstat transforms dates to dates and datetimes to datetimes, so that you have a better correspondence with the original
data. However, it is possible to keep the original pandas behavior and get always datetimes.
**4. Encoding** On python 3, pandas.read_sas reads all strings as bytes. If you want strings you have to specify the encoding manually.
pyreadstat read strings as str. Thas is possible because readstat extracts the original encoding and translates
to utf-8, so that you don't have to care about that anymore. However it is still possible to manually set the encoding.
In addition pyreadstat exposes the variable labels in an easy way (see later). As pandas dataframes cannot handle value
labels, you as user will have to take the decision whether to use those values or not. Pandas read_sas reads those labels,
but in order to recover them you have to work a bit harder.
Compared to R Haven, pyreadstat offers the possibility to read only the headers: Sometimes you want to take a
look to many (sas) files looking for the datasets that contain
some specific columns, and you want to do it quick. This package offers the possibility to read only the metadata making
it possible a very fast metadata scraping (Pandas read_sas can also do it if you pass the value iterator=True).
In addition it offers the capability to read sas7bcat files separately from the sas7bdat files.
More recently there has been a lot of interest from users on using pyreadstat to read SPSS sav files. After improvements
in pyreadstat 1.0.3 below some benchmarks are presented. The small file is 200K rows x 100 columns (152 Mb)
containing only numeric columns and
the big file is 294K rows x 666 columns (1.5 Gb). There are two versions of the big file: one containing numeric
columns only and one with a mix of numeric and character. Pyreadstat gives two ways to read files: reading in
a single process using read_sav and reading it in multiple processes using read_file_multiprocessing (see later
in the readme for more information).
| Method | small | big numeric | big mixed |
| :----- | :----: | :---------: | :-------: |
| pyreadstat read_sav | 2.3 s | 28 s | 40 s |
| pyreadstat read_file_multiprocessing | 0.8 s | 10 s | 21 s |
As you see performance degrades in pyreadstat when reading a table with both numeric and character types. This
is because numpy and pandas do not have a native type for strings but they use a generic object type which
brings a big hit in performance. The situation can be improved tough by reading files in multiple processes.
## Dependencies
The module depends on numpy and narwhals, a package to interface with pandas and polars. In addition you will need to have installed
either pandas or polars.
In order to compile from source you will need a C compiler (see installation).
Only if you want to do changes to the cython source code, you will need cython (normally not necessary).
If you want to compile for python 2.7 or windows, you will need cython (see python 2.7 support
later).
Readstat depends on the C library iconv to handle character encodings. On mac, the library is found on the system, but
users have sometimes reported problems. In those cases it may help to install libiconv with conda (see later, compilation
on mac). Readstat also depends on zlib; it was reported not to be installed by default on Lubuntu. If you face this problem installing the
library solves it.
## Installation
### Using pip
Probably the easiest way: from your conda, virtualenv or just base installation do:
```
pip install pyreadstat
```
If you are running on a machine without admin rights, and you want to install against your base installation you can do:
```
pip install pyreadstat --user
```
At the moment we offer pre-compiled wheels for windows, mac and
linux. Look at the [pypi webpage](https://pypi.org/project/pyreadstat/) to find out which python versions
are currently supported. If there is no pre-compiled
wheel available, pip will attempt to compile the source code.
### Using conda
The package is also available in [conda-forge](https://anaconda.org/conda-forge/pyreadstat) for windows, mac and linux
64 bit. Visit the Conda forge webpage to find out which python versions are currently supported.
In order to install:
```
conda install -c conda-forge pyreadstat
```
### From the latest sources
Download or clone the repo, open a command window and type:
```
python3 setup.py install
```
If you don't have admin privileges to the machine (for example on Bee) do:
```
python3 setup.py install --user
```
You can also install from the github repo directly (without cloning). Use the flag --user if necessary.
```
pip install git+https://github.com/Roche/pyreadstat.git
```
You need a working C compiler and cython >=3.0.0.
### Compiling on Windows and Mac
Compiling on linux is very easy, but on windows you need some extra preparation.
Some instructions are found [here](https://github.com/Roche/pyreadstat/blob/master/windows_compilation.md)
Compiling on mac is usually easy. Readstat depends however on the C library iconv to handle character encodings; while
on linux is part of gclib, on mac it is a separated shared library found on the system (h file is in /usr/include and shared
library on /usr/lib). While compiling against this usually works fine, some users have reported problems (for example
missing symbol _iconv, or libiconv version too old). In those cases it helped to install libiconv with conda:
```
conda install libiconv
```
and then recompile again (be sure to delete any cache, if using pip do pip --no-cache-dir, if using setup.py remove
the folder build, otherwise you may be installing the old compilation again).
## Usage
### Basic Usage
#### Reading files
Pass the path to a file to any of the functions provided by pyreadstat. It will return a pandas or polars data frame and a metadata
object.
The dataframe uses the column names. The metadata object contains the column names, column labels, number_rows,
number_columns, file label
(if any), file encoding (if applicable), notes and objects about value labels (if present). Be aware that file_label and
file_encoding may be None, not all columns may have labels, notes may not be present and there may be no value labels.
For example, in order to read a sas7bdat file:
```python
import pyreadstat
# output format by default is pandas. You can use polars to get a polars dataframe.
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', output_format="pandas")
# done! let's see what we got
print(df.head())
print(meta.column_names)
print(meta.column_labels)
print(meta.column_names_to_labels)
print(meta.number_rows)
print(meta.number_columns)
print(meta.file_label)
print(meta.file_encoding)
# there are other metadata pieces extracted. See the documentation for more details.
```
You can replace the column names by column labels very easily (but check first that all columns have distinct labels!):
```python
# replace column names with column labels
df.columns = meta.column_labels
# to go back to column names
df.columns = meta.column_names
```
As mentioned before you can very easily read into a polars dataframe by using the output_format argument:
```python
import pyreadstat
# this time df will be polars
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', output_format="polars")
# done! let's see what we got
print(df.head())
```
#### Writing files
Pyreadstat can write STATA (dta), SPSS (sav and zsav, por currently nor supported) and SAS (Xport, sas7bdat and sas7bcat
currently not supported) files from pandas or polars dataframes.
write functions take as first argument a pandas or polars dataframe (other data structures are not supported), as a second argument
the path to the destination file. Optionally you can also pass a file label and a list with column labels.
```python
import pandas as pd
import pyreadstat
# this would work the same for a polars dataframe
df = pd.DataFrame([[1,2.0,"a"],[3,4.0,"b"]], columns=["v1", "v2", "v3"])
# column_labels can also be a dictionary with variable name as key and label as value
column_labels = ["Variable 1", "Variable 2", "Variable 3"]
pyreadstat.write_sav(df, "path/to/destination.sav", file_label="test", column_labels=column_labels)
```
Some special arguments are available depending on the function. write_sav can take also notes as string or list of strings, wheter to
compress or not as zsav or apply row compression, variable display widths and variable measures. write_dta can take a stata version.
write_xport a name for the dataset. User defined missing values and value labels are also supported. See the
[Module documentation](https://ofajardo.github.io/pyreadstat_documentation/_build/html/index.html) for more details.
Here there is a relation of all functions available.
You can also check the [Module documentation](https://ofajardo.github.io/pyreadstat_documentation/_build/html/index.html).
| Function in this package | Purpose |
| ------------------- | ----------- |
| read_sas7bdat | read SAS sas7bdat files |
| read_xport | read SAS Xport (XPT) files |
| read_sas7bcat | read SAS catalog files |
| read_dta | read STATA dta files |
| read_sav | read SPSS sav and zsav files |
| read_por | read SPSS por files |
| set_catalog_to_sas | enrich sas dataframe with catalog formats |
| set_value_labels | replace values by their labels |
| read_file_in_chunks | generator to read files in chunks |
| write_sav | write SPSS sav and zsav files |
| write_por | write SPSS Portable (POR) files |
| write_dta | write STATA dta files |
| write_xport | write SAS Xport (XPT) files version 8 and 5 |
### More reading options
#### Reading only the headers
All functions accept a keyword argument "metadataonly" which by default is False. If True, then no data will be read,
but still both the metadata and the dataframe will be returned. The metadata will contain all fields as usual, but
the dataframe will be emtpy, although with the correct columns names. Sometimes number_rows may be None if it was not
possible to determine the number of rows without reading the data.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', metadataonly=True)
```
#### Reading selected columns
All functions accept a keyword "usecols" which should be a list of column names. Only the columns which names match those
in the list will be imported (case sensitive). This decreases memory consumption and speeds up the process. Usecols must
always be a list, even if there is only one member.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', usecols=["variable1", "variable2"])
```
#### Reading files in parallel processes
A challenge when reading large files is the time consumed in the operation. In order to alleviate this
pyreadstat provides a function "read\_file\_multiprocessing" to read a file in parallel processes using
the python multiprocessing library. As it reads the whole file in one go you need to have enough RAM for the operation. If
that is not the case look at Reading rows in chunks (next section). Notice however that you can combine reading in parallel
with reading in chunks as described in the next section.
Speed ups in the process will depend on a number of factors such as number of processes available, RAM,
content of the file etc.
```python
import pyreadstat
fpath = "path/to/file.sav"
df, meta = pyreadstat.read_file_multiprocessing(pyreadstat.read_sav, fpath, num_processes=4)
```
num_processes is the number of workers and it defaults to 4 (or the number of cores if less than 4). You can play with it to see where you
get the best performance. You can also get the number of all available workers like this:
```
import multiprocessing
num_processes = multiprocessing.cpu_count()
```
**Notes for Xport, Por and some defective SAV files not having the number of rows in the metadata**
1. In all Xport, Por and some defective SAV files, the number of rows cannot be determined from the metadata. In such cases,
you can use the parameter num\_rows to be equal or larger to the number of rows in the dataset. This number can be obtained
reading the file without multiprocessing, reading in another application, etc.
**Notes for windows**
1. For this to work you must include a __name__ == "__main__" section in your script. See [this issue](#85)
for more details.
```
import pyreadstat
if __name__ == "__main__":
df, meta = pyreadstat.read_file_multiprocessing(pyreadstat.read_sav, 'sample.sav')
```
2. If you include too many workers or you run out of RAM you main get a message about not enough page file
size. See [this issue](#87)
#### Reading rows in chunks
Reading large files with hundred of thouseds of rows can be challenging due to memory restrictions. In such cases, it may be helpful
to read the files in chunks.
Every reading function has two arguments row_limit and row_offset that help achieving this. row_offset makes to skip a number of rows before
start reading. row_limit makes to stop after a number of rows are read. Combining both you can read the file in chunks inside or outside a loop.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat("/path/to/file.sas7bdat", row_offset=1, row_limit=1)
# df will contain only the second row of the file
```
Pyreadstat also has a convienence function read_file_in_chunks, which returns a generator that helps you to iterate through the file in
chunks. This function takes as first argument a pyreadstat reading function and a second argument a path to a file. Optionally you can
change the size of the chunks with chunksize (default to 100000), and also add an offset and limit. You can use any keyword argument
you wish to pass to the pyreadstat reading function.
```python
import pyreadstat
fpath = "path/to/file.sas7bdat"
reader = pyreadstat.read_file_in_chunks(pyreadstat.read_sas7bdat, fpath, chunksize= 10, offset=2, limit=100, disable_datetime_conversion=True)
for df, meta in reader:
print(df) # df will contain 10 rows except for the last one
# do some cool calculations here for the chunk
```
For very large files it may be convienient to speed up the process by reading each chunks in parallel. For
this purpose you can pass the argument multiprocess=True. This is a combination of read_file_in_chunks and
read_file_multiprocessing. Here you can use the arguments row_offset and row_limit to start reading the
file from an offest and stop after a row_offset+row_limit.
```python
import pyreadstat
fpath = "path/to/file.sav"
reader = pyreadstat.read_file_in_chunks(pyreadstat.read_sav, fpath, chunksize= 10000, multiprocess=True, num_processes=4)
for df, meta in reader:
print(df) # df will contain 10000 rows except for the last one
# do some cool calculations here for the chunk
```
**If using multiprocessing, please read the notes in the previous section regarding Xport, Por and some defective SAV files not
having the number of rows in the metadata**
**For Windows, please check the notes on the previous section reading files in parallel processes**
#### Reading value labels
For sas7bdat files, value labels are stored in separated sas7bcat files. You can use them in combination with the sas7bdat
or read them separately.
If you want to read them in combination with the sas7bdat files, pass the path to the sas7bcat files to the read_sas7bdat
function. The original values will be replaced by the values in the catalog.
```python
import pyreadstat
# formats_as_category is by default True, and it means the replaced values will be transformed to a pandas/polars category column. There is also formats_as_ordered_category to get an ordered category, this by default is False.
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', catalog_file='/path/to/a/file.sas7bcat', formats_as_category=True, formats_as_ordered_category=False)
```
If you prefer to read the sas7bcat file separately, you can apply the formats later with the function set_catalog_to_sas.
In this way you can have two copies of the dataframe, one with catalog and one without.
```python
import pyreadstat
# this df will have the original values
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat')
# read_sas7bdat returns an emtpy data frame and the catalog
df_empty, catalog = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bcat')
# enrich the dataframe with the catalog
# formats_as_category is by default True, and it means the replaced values will be transformed to a pandas/polars category column. formats_as_ordered_category is by default False meaning by default categories are not ordered.
df_enriched, meta_enriched = pyreadstat.set_catalog_to_sas(df, meta, catalog,
formats_as_category=True, formats_as_ordered_category=False)
```
For SPSS and STATA files, the value labels are included in the files. You can choose to replace the values by the labels
when reading the file using the option apply_value_formats, ...
```python
import pyreadstat
# apply_value_formats is by default False, so you have to set it to True manually if you want the labels
# formats_as_category is by default True, and it means the replaced values will be transformed to a pandas/polars category column. formats_as_ordered_category is by default False meaning by default categories are not ordered.
df, meta = pyreadstat.read_sav("/path/to/sav/file.sav", apply_value_formats=True,
formats_as_category=True, formats_as_ordered_category=False)
```
... or to do it later with the function set_value_labels:
```python
import pyreadstat
# This time no value labels.
df, meta = pyreadstat.read_sav("/path/to/sav/file.sav", apply_value_formats=False)
# now let's add them to a second copy
df_enriched = pyreadstat.set_value_labels(df, meta, formats_as_category=True, formats_as_ordered_category=False)
```
Internally each variable is associated with a label set. This information is stored in meta.variable_to_label. Each
label set contains a map of the actual value in the variable to the label, this informtion is stored in
meta.variable_value_labels. By combining both you can get a dictionary of variable names to a dictionary of actual
values to labels.
For SPSS and STATA:
```python
import pyreadstat
df, meta = pyreadstat.read_sav("test_data/basic/sample.sav")
# the variables mylabl and myord are associated to the label sets labels0 and labels1 respectively
print(meta.variable_to_label)
#{'mylabl': 'labels0', 'myord': 'labels1'}
# labels0 and labels1 contain a dictionary of actual value to label
print(meta.value_labels)
#{'labels0': {1.0: 'Male', 2.0: 'Female'}, 'labels1': {1.0: 'low', 2.0: 'medium', 3.0: 'high'}}
# both things have been joined by pyreadstat for convienent use
print(meta.variable_value_labels)
#{'mylabl': {1.0: 'Male', 2.0: 'Female'}, 'myord': {1.0: 'low', 2.0: 'medium', 3.0: 'high'}}
```
SAS is very similar except that meta.variable_to_label comes from the sas7bdat file and meta.value_labels comes from the
sas7bcat file. That means if you read a sas7bdat file and a sas7bcat file togheter meta.variable_value_labels will be
filled in. If you read only the sas7bdat file only meta.variable_to_label will be available and if you read the
sas7bcat file only meta.value_labels will be available. If you read a sas7bdat file and there are no associated label
sets, SAS will assign by default the variable format as label sets.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat("test_data/sas_catalog/test_data_linux.sas7bdat")
meta.variable_to_label
{'SEXA': '$A', 'SEXB': '$B'}
df2, meta2 = pyreadstat.read_sas7bcat("test_data/sas_catalog/test_formats_linux.sas7bcat")
meta2.value_labels
{'$A': {'1': 'Male', '2': 'Female'}, '$B': {'2': 'Female', '1': 'Male'}}
```
#### Missing Values
There are two types of missing values: system and user defined. System are assigned by the program by default. User defined are
valid values that the user decided to give the meaning of missing in order to differentiate between several situations.For
example if one has a categorical variable representing if the person passed a test, you could have 0 for did not pass,
1 for pass, and as user defined missing variables 2 for did not show up for the test, 3 for unable to process the results,
etc.
**By default both cases are represented by NaN in pandas and null in polars when
read with pyreadstat**. Notice that the only possible missing value in pandas is NaN (Not a Number) for both string and numeric
variables, date, datetime and time variables have NaT (Not a Time). Polars use null for all datatypes.
##### SPSS
In the case of SPSS sav files, the user can assign to a numeric variable either up to three discrete missing values or
one range plus one discrete missing value. As mentioned by default all of these possiblities are translated into NaN,
but one can get those original values by passing the argument user_missing=True to the read_sav function:
```python
# user set with default missing values
import pyreadstat
df, meta = pyreadstat.read_sav("/path/to/file.sav")
print(df)
>> test_passed
1
0
NaN
NaN
```
Now, reading the user defined missing values:
```python
# user set with user defined missing values
import pyreadstat
df, meta = pyreadstat.read_sav("/path/to/file.sav", user_missing=True)
print(df)
>> test_passed
1
0
2
3
```
As you see now instead o NaN the values 2 and 3 appear. In case the dataset had value labels, we could bring those in
```python
# user set with user defined missing values and labels
import pyreadstat
df, meta = pyreadstat.read_sav("/path/to/file.sav", user_missing=True, apply_value_formats=True)
print(df)
>> test_passed
"passed"
"not passed"
"not shown"
"not processed"
```
Finally, the information about what values are user missing is stored in the meta object, in the variable missing_ranges.
This is a dicitonary with the key being the name of the variable, and as value a list of dictionaries, each dictionary
contains the elements "hi" and "lo" to represent the lower and upper bound of the range, however for discrete values
as in the example, both boundaries are also present although the value is the same in both cases.
```python
# user set with default missing values
import pyreadstat
df, meta = pyreadstat.read_sav("/path/to/file.sav", user_missing=True, apply_value_formats=True)
print(meta.missing_ranges)
>>> {'test_passed':[{'hi':2, 'lo':2}, {'hi':3, 'lo':3}]}
```
SPSS sav files also support up to 3 discrete user defined missing values for non numeric (character) variables.
Pyreadstat is able to read those and the behavior is the same as for discrete
numerical user defined missing values. That means those values will be
translated as NaN by default and to the correspoding string value if
user_missing is set to True. meta.missing_ranges will show the string
value as well.
When writing a dataframe to a sav file, if user defined missing values are not set, NaNs are translated to
empty strings, as there is no other possibility to represent those missing values and user defined missing values
are not set automatically.
When reading a sav into a dataframe, if the value in
a character variable is an empty string (''), it will not be translated to NaN/null, but will stay as an empty string. This
is because the empty string is a valid character value in SPSS and pyreadstat preserves that property.
This behaviour generates an asymetrical situation that has to be managed by the user. You can convert
empty strings to nan very easily if you think it is appropiate
for your dataset, or you can use defined missing values as described before.
##### SAS and STATA
In SAS the user can assign values from .A to .Z and ._ as user defined missing values. In Stata values from
.a to .z. As in SPSS, those are normally translated to
NaN. However, using user_missing=True with read_sas7bdat or read_dta
will produce values from A to Z and _ for SAS and a to z for dta. In addition a variable
missing_user_values will appear in the metadata object, being a list with those values that are user defined missing
values.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat("/path/to/file.sas7bdat", user_missing=True)
df, meta = pyreadstat.read_dta("/path/to/file.dta", user_missing=True)
print(meta.missing_user_values)
```
The user may also assign a label to user defined missing values. In such
case passing the corresponding sas7bcat file to read_sas7bdat or using
the option apply_value_formats to read_dta will show those labels instead
of the user defined missing value.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat("/path/to/file.sas7bdat", catalog_file="/path/to/file.sas7bcat", user_missing=True)
df, meta = pyreadstat.read_dta("/path/to/file.dta", user_missing=True, apply_value_formats=True)
```
Empty strings are still transtaled as empty strings and not as NaN.
The information about what values are user missing is stored in the meta object, in the variable missing_user_values.
This is a list listing all user defined missing values.
User defined missing values are currently not supported for file types other than sas7bdat,
sas7bcat and dta.
#### Reading datetime and date columns
SAS, SPSS and STATA represent datetime, date and other similar concepts as a numeric column and then applies a
display format on top. Roughly speaking, internally there are two possible representations: one for concepts with a day or lower
granularity (date, week, quarter, year, etc.) and those with a higher granularity than a day (datetime, time, hour, etc).
The first group is suceptible to be converted to a python date object and the second to a python datetime object.
Pyreadstat attempts to read columns with datetime, date and time formats that are convertible
to python datetime, date and time objects automatically. However there are other formats that are not fully convertible to
any of these formats, for example SAS "YEAR" (displaying only the year), "MMYY" (displaying only month and year), etc.
Because there are too many of these formats and these keep changing, it is not possible to implement a rule for each of
those, therefore these columns are not transformed and the user will obtain a numeric column.
In order to cope with this issue, there are two options for each reader function: extra\_datetime\_formats and
extra\_date\_formats that allow the user to
pass these datetime or date formats, to transform the numeric values into datetime or date python objects. Then, the user
can format those columns appropiately; for example extracting the year only to an integer column in the case of 'YEAR' or
formatting it to a string 'YYYY-MM' in the case of 'MMYY'. The choice between datetime or date format depends on the granularity
of the data as explained above.
This arguments are also useful in the case you have a valid datetime, date or time format that is currently not recognized in pyreadstat.
In those cases, feel free to file an issue to ask those to be added to the list, in the meantime you can use these arguments to do
the conversion.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', extra_date_formats=["YEAR", "MMYY"])
```
#### Reading from file-like objects
pyreadstat can read directly from file-like objects instead of file paths. This is useful for:
- Reading from zip archives without extracting to disk
- Reading from in-memory buffers (BytesIO)
- Streaming from remote sources
**Reading from a zip archive:**
```python
import zipfile
import pyreadstat
with zipfile.ZipFile('archive.zip') as zf:
with zf.open('data.sav') as f:
df, meta = pyreadstat.read_sav(f)
```
**Reading from a remote URL:**
```python
import io
import requests
import pyreadstat
response = requests.get('https://example.com/data.sav')
df, meta = pyreadstat.read_sav(io.BytesIO(response.content))
```
This approach avoids downloading large files to disk, which can significantly improve performance and reduce
disk space requirements when working with remote data or compressed archives.
#### Other options
You can set the encoding of the original file manually. The encoding must be a [iconv-compatible encoding](https://gist.github.com/hakre/4188459).
This is absolutely necessary if you are handling old xport files with
non-ascii characters. Those files do not have stamped the encoding in the
file itself, therefore the encoding must be set manually. For SPSS POR files it is not possible to set the encoding and
files are assumed to be always encoded in UTF-8.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', encoding="LATIN1")
```
You can preserve the original pandas behavior regarding dates (meaning dates are converted to pandas datetime) with the
dates_as_pandas_datetime option. This option is effective for pandas only, not for polars.
```python
import pyreadstat
df, meta = pyreadstat.read_sas7bdat('/path/to/a/file.sas7bdat', dates_as_pandas_datetime=True)
```
You can get a dictionary of numpy arrays instead of a pandas or polars dataframe when reading any file format.
In order to do that, set the parameter output_format='dict' (default is 'pandas', the other option is 'polars'). This is useful if
you want to transform the data to some other format different to pandas/polars, as transforming the data to pandas is a costly
process both in terms of speed and memory.
For more information, please check the [Module documentation](https://ofajardo.github.io/pyreadstat_documentation/_build/html/index.html).
### More writing options
#### File specific options
Some special arguments are available depending on the function. write_sav can take also notes as string or list of strings, wheter to
compress or not as zsav or apply row compression, variable display widths and variable measures. write_dta can take a stata version.
write_xport a name for the dataset. See the
[Module documentation](https://ofajardo.github.io/pyreadstat_documentation/_build/html/index.html) for more details.
#### Writing value labels
The argument variable_value_labels can be passed to write_sav and write_dta to write value labels. This argument must be a
dictionary where keys are variable names (names must match column names in the dataframe). Values are another dictionary where
keys are the value present in the dataframe and values are the labels (strings).
```python
import pandas as pd
import pyreadstat
df = pd.DataFrame([[1,1],[2,2],[1,3]], columns=['mylabl', 'myord'])
variable_value_labels = {'mylabl': {1: 'Male', 2: 'Female'}, 'myord': {1: 'low', 2: 'medium', 3: 'high'}}
path = "/path/to/somefile.sav"
pyreadstat.write_sav(df, path, variable_value_labels=variable_value_labels)
```
#### Writing user defined missing values
##### SPSS
The argument missing_ranges can be passed to write_sav to write user defined missing values.
This argument be a dictionary with keys as variable names matching variable
names in the dataframe. The values must be a list. Each element in that list can either be
either a discrete numeric or string value (max 3 per variable) or a dictionary with keys 'hi' and 'lo' to
indicate the upper and lower range for numeric values (max 1 range value + 1 discrete value per
variable). hi and lo may also be the same value in which case it will be interpreted as a discrete
missing value. For this to be effective, values in the dataframe must be the same as reported here and not NaN.
```python
import pandas as pd
import pyreadstat
df = pd.DataFrame([["a",1],["c",2],["c",3]], columns=['mychar', 'myord'])
missing_ranges = {'mychar':['a'], 'myord': [{'hi':2, 'lo':1}]}
path = "/path/to/somefile.sav"
pyreadstat.write_sav(df, path, missing_ranges=missing_ranges)
```
##### STATA
The argument missing_user_values can be passed to write_dta to write user defined missing values only for numeric variables.
This argument be a dictionary with keys as variable names matching variable
names in the dataframe. The values must be a list of missing values, valid values are single character strings
between a and z. Optionally a value label can also be attached to those missing values using variable_value_labels.
```python
import pandas as pd
import pyreadstat
df = pd.DataFrame([["a", 1],[2.2, 2],[3.3, "b"]], columns=['Var1', 'Var2'])
variable_value_labels = {'Var1':{'a':'a missing value'}
missing_ranges = {'Var1':['a'], 'Var2': ['b']}
path = "/path/to/somefile.sav"
pyreadstat.write_sav(df, path, missing_ranges=missing_ranges, variable_value_labels=variable_value_labels)
```
#### Setting variable formats
Numeric types in SPSS, SAS and STATA can have formats that affect how those values are displayed to the user
in the application. Pyreadstat automatically sets the formatting in some cases, as for example when translating
dates or datetimes (which in SPSS/SAS/STATA are just numbers with a special format). The user can however specify custom formats
for their columns with the argument "variable_format", which is
a dictionary with the column name as key and a string with the format as values:
```python
import pandas as pd
import pyreadstat
path = "path/where/to/write/file.sav"
df = pd.DataFrame({'restricted':[1023, 10], 'integer':[1,2]})
formats = {'restricted':'N4', 'integer':'F1.0'}
pyreadstat.write_sav(df, path, variable_format=formats)
```
The appropiate formats to use are beyond the scope of this documentation. Probably you want to read a file
produced in the original application and use meta.original_variable\_types to get the formats. Otherwise look
for the documentation of the original application.
##### SPSS
In the case of SPSS we have some presets for some formats:
* restricted_integer: with leading zeros, equivalent to N + variable width (e.g N4)
* integer: Numeric with no decimal places, equivalent to F + variable width + ".0" (0 decimal positions). A
column of type integer will also be translated into this format automatically.
```python
import pandas as pd
import pyreadstat
path = "path/where/to/write/file.sav"
df = pd.DataFrame({'restricted':[1023, 10], 'integer':[1,2]})
formats = {'restricted':'restricted_integer', 'integer':'integer'}
pyreadstat.write_sav(df, path, variable_format=formats)
```
There is some information about the possible formats [here](https://www.gnu.org/software/pspp/pspp-dev/html_node/Variable-Record.html).
#### Variable type conversion
The following rules are used in order to convert from pandas/polars/numpy/python types to the target file types:
| Python Type | Converted Type |
| ------------------- | --------- |
| np.int32/pl.int32 or lower | integer (stata), numeric (spss, sas) |
| int, np.int64, pl.int64, np.float, pl.float64 | double (stata), numeric (spss, sas) |
| str | character |
| bool | integer (stata), numeric (spss, sas) |
| datetime, date, time | numeric with datetime/date/time formatting |
| category | depends on the original dtype |
| any other object | character |
| column all missing | integer (stata), numeric (spss, sas) |
| column with mixed types | character |
Columns with mixed types are translated to character. This does not apply to column
cotaining np.nan, where the missing values are correctly translated. It also does not apply to columns with
user defined missing values in stata/sas where characters (a to z, A to Z, \_) will be recorded as numeric.
## Roadmap
* Include latest releases from Readstat as they come out.
## CD/CI and Wheels
A CD/CI pipeline producing the wheels is available [here](https://github.com/ofajardo/pyreadstat_wheels5). Contributions
are welcome.
## Known limitations
pyreadstat builds on top of Readstat and therefore inherits its limitations. Currently those include:
* Cannot write SAS sas7bdat. Those files can be written but not read in
SAS and therefore are not supported in pyreadstat. (see [here](https://github.com/WizardMac/ReadStat/issues/98))
Converting data types from foreign applications into python some times also bring some limitations:
* Pyreadstat transforms date, datetime and time like variables which are internally represented in the original application as
numbers to python datetime objects. Python datetime objects are however limited in the range of dates they can represent
(for example the max year is 10,000), while in other applications it is possible (although probably an error in the data)
to have very high or very low dates. In this cases pyreadstat would raise an error:
```
OverflowError: date value out of range
```
The workaround is to deal with this include using the keyword argument disable_datetime_conversion so that you will
get numbers instead of datetime objects or skipping reading such columns with the argument usecols.
## Python 2.7 support.
As version 1.2.3 Python 2.7 is not supported. In previous versions it was possible to compile it for
mac and linux but not for windows, but no wheels were provided. In linux and mac it will fail if
the path file contains non-ascii characters.
## Change log
A log with the changes for each version can be found [here](https://github.com/Roche/pyreadstat/blob/master/change_log.md)
## License
pyreadstat is distributed under Apache 2.0 license. Readstat is distributed under MIT license. See the License file for
more information.
## Contributing
Contributions are welcome! Those include corrections to the documentation, bugs reporting, testing,
and of course code pull requests. For code pull requests please
consider opening an issue explaining what you plan to do, so that we can get aligned before you start investing time on
it (this also avoids duplicated efforts).
The ReadStat code in this repo (under the subfolder src) is coming from the main Readstat trunk and should not be
modified in order to
keep full compatibility with the original. In that way improvements in ReadStat can be taken here with almost
no effort. If you would like to propose new features involving changes in the ReadStat code, please submit a
pull request to ReadStat first.
## People
[Otto Fajardo](https://github.com/ofajardo) - author, maintainer
[Matthew Brett](http://matthew.dynevor.org/) - contributor [python wheels](https://github.com/MacPython/pyreadstat-wheels)
[Jonathon Love](https://jona.thon.love/) - contributor: open files with international characters. Function to open files for writing.
[Clemens Brunner](https://github.com/cbrnr) - integration with pandas.read_spss
[Thomas Grainger](https://github.com/graingert) - corrections and suggestions to source code
[benjello](https://github.com/benjello), [maxwell8888](https://github.com/maxwell8888), [drcjar](https://github.com/drcjar), [labenech](https://github.com/labenech): improvements to documentation
[alchemyst](https://github.com/alchemyst): improvements to docstrings
[bmwiedemann](https://github.com/bmwiedemann), [toddrme2178 ](https://github.com/toddrme2178), [Martin Thorsen Ranang](https://github.com/mtr): improvements to source code
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1721316780.0
pyreadstat-1.3.3/pyproject.toml 0000644 0000765 0000024 00000000162 14646232654 015165 0 ustar 00 dialout [build-system]
requires = [
"setuptools",
"wheel",
"cython"
]
build-backend = "setuptools.build_meta"
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1769180459.0
pyreadstat-1.3.3/pyreadstat/ 0000755 0000765 0000024 00000000000 15134706453 014426 5 ustar 00 dialout ././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1767630290.0
pyreadstat-1.3.3/pyreadstat/__init__.py 0000644 0000765 0000024 00000002320 15126762722 016536 0 ustar 00 dialout # #############################################################################
# Copyright 2018 Hoffmann-La Roche
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# #############################################################################
from .pyreadstat import read_sas7bdat, read_xport, read_dta, read_sav, read_por, read_sas7bcat
from .pyreadstat import write_sav, write_dta, write_xport, write_por
#from .pyreadstat import set_value_labels, set_catalog_to_sas
#from .pyreadstat import set_catalog_to_sas
from .pyreadstat import read_file_in_chunks, read_file_multiprocessing
from ._readstat_parser import ReadstatError, metadata_container
from .pyfunctions import set_value_labels, set_catalog_to_sas
__version__ = "1.3.3"
././@PaxHeader 0000000 0000000 0000000 00000000026 00000000000 010213 x ustar 00 22 mtime=1769180456.0
pyreadstat-1.3.3/pyreadstat/_readstat_parser.c 0000644 0000765 0000024 00004516614 15134706450 020132 0 ustar 00 dialout /* Generated by Cython 3.1.2 */
/* BEGIN: Cython Metadata
{
"distutils": {
"depends": [
"pyreadstat/conditional_includes.h",
"src/readstat.h",
"src/readstat_io_unistd.h"
],
"extra_compile_args": [
"-Ireadstat",
"-DHAVE_ZLIB=1"
],
"include_dirs": [
"pyreadstat",
"src",
"src/sas",
"src/spss",
"src/stata",
"."
],
"libraries": [
"m",
"z",
"iconv"
],
"name": "pyreadstat._readstat_parser",
"sources": [
"pyreadstat/_readstat_parser.pyx",
"./src/CKHashTable.c",
"./src/readstat_bits.c",
"./src/readstat_convert.c",
"./src/readstat_error.c",
"./src/readstat_io_unistd.c",
"./src/readstat_malloc.c",
"./src/readstat_metadata.c",
"./src/readstat_parser.c",
"./src/readstat_value.c",
"./src/readstat_variable.c",
"./src/readstat_writer.c",
"./src/sas/ieee.c",
"./src/sas/readstat_sas.c",
"./src/sas/readstat_sas7bcat_read.c",
"./src/sas/readstat_sas7bcat_write.c",
"./src/sas/readstat_sas7bdat_read.c",
"./src/sas/readstat_sas7bdat_write.c",
"./src/sas/readstat_sas_rle.c",
"./src/sas/readstat_xport.c",
"./src/sas/readstat_xport_parse_format.c",
"./src/sas/readstat_xport_read.c",
"./src/sas/readstat_xport_write.c",
"./src/spss/readstat_por.c",
"./src/spss/readstat_por_parse.c",
"./src/spss/readstat_por_read.c",
"./src/spss/readstat_por_write.c",
"./src/spss/readstat_sav.c",
"./src/spss/readstat_sav_compress.c",
"./src/spss/readstat_sav_parse.c",
"./src/spss/readstat_sav_parse_mr_name.c",
"./src/spss/readstat_sav_parse_timestamp.c",
"./src/spss/readstat_sav_read.c",
"./src/spss/readstat_sav_write.c",
"./src/spss/readstat_spss.c",
"./src/spss/readstat_spss_parse.c",
"./src/spss/readstat_zsav_compress.c",
"./src/spss/readstat_zsav_read.c",
"./src/spss/readstat_zsav_write.c",
"./src/stata/readstat_dta.c",
"./src/stata/readstat_dta_parse_timestamp.c",
"./src/stata/readstat_dta_read.c",
"./src/stata/readstat_dta_write.c"
]
},
"module_name": "pyreadstat._readstat_parser"
}
END: Cython Metadata */
#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API)
#define CYTHON_LIMITED_API 1
#endif
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x03080000
#error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_1_2"
#define CYTHON_HEX_VERSION 0x030102F0
#define CYTHON_FUTURE_DIVISION 0
/* CModulePreamble */
#include
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
#define __stdcall
#endif
#ifndef __cdecl
#define __cdecl
#endif
#ifndef __fastcall
#define __fastcall
#endif
#endif
#ifndef DL_IMPORT
#define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
#define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
#define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
/* For very preliminary testing purposes. Most variables are set the same as PyPy.
The existence of this section does not imply that anything works or is even tested */
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_LIMITED_API 0
#define CYTHON_COMPILING_IN_GRAAL 1
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 0
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#undef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#undef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#undef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#undef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING 0
#undef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 0
#undef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND 0
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 1
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif
#undef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_LIMITED_API 0
#define CYTHON_COMPILING_IN_GRAAL 0
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#ifndef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 0
#endif
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#undef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 1
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#ifndef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 1
#endif
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#undef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL 0
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#if PY_VERSION_HEX < 0x03090000
#undef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
#elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#undef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#undef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING 0
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
#endif
#undef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND 0
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
#endif
#undef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
#ifdef Py_LIMITED_API
#undef __PYX_LIMITED_VERSION_HEX
#define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
#endif
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 0
#define CYTHON_COMPILING_IN_LIMITED_API 1
#define CYTHON_COMPILING_IN_GRAAL 0
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#undef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK 0
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 0
#undef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 1
#undef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 0
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#undef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 0
#ifndef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#endif
#undef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 0
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
#endif
#undef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 0
#undef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 0
#undef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 0
#undef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 0
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#undef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#undef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 0
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#endif
#undef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING 0
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 0
#endif
#ifndef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
#endif
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#undef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 0
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
#endif
#undef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#define CYTHON_COMPILING_IN_LIMITED_API 0
#define CYTHON_COMPILING_IN_GRAAL 0
#ifdef Py_GIL_DISABLED
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
#else
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
#endif
#if PY_VERSION_HEX < 0x030A0000
#undef CYTHON_USE_TYPE_SLOTS
#define CYTHON_USE_TYPE_SLOTS 1
#elif !defined(CYTHON_USE_TYPE_SLOTS)
#define CYTHON_USE_TYPE_SLOTS 1
#endif
#ifndef CYTHON_USE_TYPE_SPECS
#define CYTHON_USE_TYPE_SPECS 0
#endif
#ifndef CYTHON_USE_PYTYPE_LOOKUP
#define CYTHON_USE_PYTYPE_LOOKUP 1
#endif
#ifndef CYTHON_USE_PYLONG_INTERNALS
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_USE_PYLIST_INTERNALS
#define CYTHON_USE_PYLIST_INTERNALS 0
#elif !defined(CYTHON_USE_PYLIST_INTERNALS)
#define CYTHON_USE_PYLIST_INTERNALS 1
#endif
#ifndef CYTHON_USE_UNICODE_INTERNALS
#define CYTHON_USE_UNICODE_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
#undef CYTHON_USE_UNICODE_WRITER
#define CYTHON_USE_UNICODE_WRITER 0
#elif !defined(CYTHON_USE_UNICODE_WRITER)
#define CYTHON_USE_UNICODE_WRITER 1
#endif
#ifndef CYTHON_AVOID_BORROWED_REFS
#define CYTHON_AVOID_BORROWED_REFS 0
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
#elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
#endif
#ifndef CYTHON_ASSUME_SAFE_MACROS
#define CYTHON_ASSUME_SAFE_MACROS 1
#endif
#ifndef CYTHON_ASSUME_SAFE_SIZE
#define CYTHON_ASSUME_SAFE_SIZE 1
#endif
#ifndef CYTHON_UNPACK_METHODS
#define CYTHON_UNPACK_METHODS 1
#endif
#ifndef CYTHON_FAST_THREAD_STATE
#define CYTHON_FAST_THREAD_STATE 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_FAST_GIL
#define CYTHON_FAST_GIL 0
#elif !defined(CYTHON_FAST_GIL)
#define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
#endif
#ifndef CYTHON_METH_FASTCALL
#define CYTHON_METH_FASTCALL 1
#endif
#ifndef CYTHON_FAST_PYCALL
#define CYTHON_FAST_PYCALL 1
#endif
#ifndef CYTHON_PEP487_INIT_SUBCLASS
#define CYTHON_PEP487_INIT_SUBCLASS 1
#endif
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
#endif
#ifndef CYTHON_USE_MODULE_STATE
#define CYTHON_USE_MODULE_STATE 0
#endif
#ifndef CYTHON_USE_SYS_MONITORING
#define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
#endif
#ifndef CYTHON_USE_TP_FINALIZE
#define CYTHON_USE_TP_FINALIZE 1
#endif
#ifndef CYTHON_USE_AM_SEND
#define CYTHON_USE_AM_SEND 1
#endif
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#undef CYTHON_USE_DICT_VERSIONS
#define CYTHON_USE_DICT_VERSIONS 0
#elif !defined(CYTHON_USE_DICT_VERSIONS)
#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
#endif
#ifndef CYTHON_USE_EXC_INFO_STACK
#define CYTHON_USE_EXC_INFO_STACK 1
#endif
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
#define CYTHON_UPDATE_DESCRIPTOR_DOC 1
#endif
#ifndef CYTHON_USE_FREELISTS
#define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
#endif
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
#undef SHIFT
#undef BASE
#undef MASK
#ifdef SIZEOF_VOID_P
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
#endif
#endif
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
#define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
#define CYTHON_RESTRICT __restrict__
#elif defined(_MSC_VER) && _MSC_VER >= 1400
#define CYTHON_RESTRICT __restrict
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_RESTRICT restrict
#else
#define CYTHON_RESTRICT
#endif
#endif
#ifndef CYTHON_UNUSED
#if defined(__cplusplus)
/* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
* but leads to warnings with -pedantic, since it is a C++17 feature */
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#if __has_cpp_attribute(maybe_unused)
#define CYTHON_UNUSED [[maybe_unused]]
#endif
#endif
#endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
# define CYTHON_UNUSED __attribute__ ((__unused__))
# else
# define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
# if defined(__cplusplus)
template void CYTHON_UNUSED_VAR( const T& ) { }
# else
# define CYTHON_UNUSED_VAR(x) (void)(x)
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
# define CYTHON_NCP_UNUSED
# else
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
#if defined(__cplusplus) && (\
__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
#define CYTHON_USE_CPP_STD_MOVE 1
#else
#define CYTHON_USE_CPP_STD_MOVE 0
#endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
#ifndef _MSC_STDINT_H_
#if _MSC_VER < 1300
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#else
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
#endif
#endif
#if _MSC_VER < 1300
#ifdef _WIN64
typedef unsigned long long __pyx_uintptr_t;
#else
typedef unsigned int __pyx_uintptr_t;
#endif
#else
#ifdef _WIN64
typedef unsigned __int64 __pyx_uintptr_t;
#else
typedef unsigned __int32 __pyx_uintptr_t;
#endif
#endif
#else
#include
typedef uintptr_t __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
#if defined(__cplusplus)
/* for clang __has_cpp_attribute(fallthrough) is true even before C++17
* but leads to warnings with -pedantic, since it is a C++17 feature */
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
#if __has_cpp_attribute(fallthrough)
#define CYTHON_FALLTHROUGH [[fallthrough]]
#endif
#endif
#ifndef CYTHON_FALLTHROUGH
#if __has_cpp_attribute(clang::fallthrough)
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
#elif __has_cpp_attribute(gnu::fallthrough)
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
#endif
#endif
#endif
#ifndef CYTHON_FALLTHROUGH
#if __has_attribute(fallthrough)
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
#else
#define CYTHON_FALLTHROUGH
#endif
#endif
#if defined(__clang__) && defined(__apple_build_version__)
#if __apple_build_version__ < 7000000
#undef CYTHON_FALLTHROUGH
#define CYTHON_FALLTHROUGH
#endif
#endif
#endif
#ifndef Py_UNREACHABLE
#define Py_UNREACHABLE() assert(0); abort()
#endif
#ifdef __cplusplus
template
struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
#define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL::value)
#else
#define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
#define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
#define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
/* CInitCode */
#ifndef CYTHON_INLINE
#if defined(__clang__)
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
#elif defined(__GNUC__)
#define CYTHON_INLINE __inline__
#elif defined(_MSC_VER)
#define CYTHON_INLINE __inline
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CYTHON_INLINE inline
#else
#define CYTHON_INLINE
#endif
#endif
/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
#ifndef CO_OPTIMIZED
static int CO_OPTIMIZED;
#endif
#ifndef CO_NEWLOCALS
static int CO_NEWLOCALS;
#endif
#ifndef CO_VARARGS
static int CO_VARARGS;
#endif
#ifndef CO_VARKEYWORDS
static int CO_VARKEYWORDS;
#endif
#ifndef CO_ASYNC_GENERATOR
static int CO_ASYNC_GENERATOR;
#endif
#ifndef CO_GENERATOR
static int CO_GENERATOR;
#endif
#ifndef CO_COROUTINE
static int CO_COROUTINE;
#endif
#else
#ifndef CO_COROUTINE
#define CO_COROUTINE 0x80
#endif
#ifndef CO_ASYNC_GENERATOR
#define CO_ASYNC_GENERATOR 0x200
#endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
#define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
#define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
#define __Pyx_Py_Is(x, y) Py_Is(x, y)
#else
#define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
#define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
#define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
#define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
#define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
#define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
#define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
#define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
#define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
#define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
#define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
#ifndef METH_FASTCALL
#define METH_FASTCALL 0x80
#endif
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
Py_ssize_t nargs, PyObject *kwnames);
#else
#if PY_VERSION_HEX >= 0x030d00A4
# define __Pyx_PyCFunctionFast PyCFunctionFast
# define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
#else
# define __Pyx_PyCFunctionFast _PyCFunctionFast
# define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#endif
#if CYTHON_METH_FASTCALL
#define __Pyx_METH_FASTCALL METH_FASTCALL
#define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
#define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
#define __Pyx_METH_FASTCALL METH_VARARGS
#define __Pyx_PyCFunction_FastCall PyCFunction
#define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
#define __pyx_vectorcallfunc vectorcallfunc
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
#define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
size_t nargsf, PyObject *kwnames);
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
#define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
#define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x03090000
#define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
#define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
#define __Pyx_PyCMethod PyCMethod
#endif
#ifndef METH_METHOD
#define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
#define PyObject_Malloc(s) PyMem_Malloc(s)
#define PyObject_Free(p) PyMem_Free(p)
#define PyObject_Realloc(p) PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
#define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
void *result;
result = PyModule_GetState(op);
if (!result)
Py_FatalError("Couldn't find the module state");
return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
#define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
#define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
#define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
#define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
#define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
(PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
__Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
#define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
#define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
#endif
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
if (res == NULL) PyErr_Clear();
return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
return PyDict_GetItem(dict, name);
#else
PyDictEntry *ep;
PyDictObject *mp = (PyDictObject*) dict;
long hash = ((PyStringObject *) name)->ob_shash;
assert(hash != -1);
ep = (mp->ma_lookup)(mp, name, hash);
if (ep == NULL) {
return NULL;
}
return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
#define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
#define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
#define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
PyTypeObject *type = Py_TYPE((PyObject*)obj);\
assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
PyObject_GC_Del(obj);\
Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
#define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
#define __Pyx_PyUnicode_DATA(u) ((void*)u)
#define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
#else
#if PY_VERSION_HEX >= 0x030C0000
#define __Pyx_PyUnicode_READY(op) (0)
#else
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#endif
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
#if PY_VERSION_HEX >= 0x030C0000
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
#else
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
#else
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#endif
#endif
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
#else
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
#if !defined(PyUnicode_DecodeUnicodeEscape)
#define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
#endif
#if !defined(PyUnicode_Contains)
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
#endif
#if !defined(PyByteArray_Check)
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if !defined(PyObject_Format)
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PySequence_ListKeepNew(obj)\
(likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
#define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
#define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
#else
#define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
#endif
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
#else
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
#endif
#else
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
*result = PyObject_GetItem(dict, key);
if (*result == NULL) {
if (PyErr_ExceptionMatches(PyExc_KeyError)) {
PyErr_Clear();
return 0;
}
return -1;
}
return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
*result = PyDict_GetItemWithError(dict, key);
if (*result == NULL) {
return PyErr_Occurred() ? -1 : 0;
}
Py_INCREF(*result);
return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
#define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
#else
#define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
#define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
#define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
#define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
#define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
#define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
#define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
#define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
#define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
#define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
#define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
#define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
#define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
#define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
#define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
#define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
#define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
#define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
PyObject *module = PyImport_AddModule(name);
Py_XINCREF(module);
return module;
}
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __Pyx_PySendResult PySendResult
#else
typedef enum {
PYGEN_RETURN = 0,
PYGEN_ERROR = -1,
PYGEN_NEXT = 1,
} __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
#define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
__Pyx_pyiter_sendfunc am_send;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
#define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
#define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
int value;
PyObject *py_value = PyObject_GetAttrString(inspect, name);
if (!py_value) return 0;
value = (int) PyLong_AsLong(py_value);
Py_DECREF(py_value);
*write_to = value;
return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
PyObject *inspect;
int result;
inspect = PyImport_ImportModule("inspect");
result =
#if !defined(CO_OPTIMIZED)
__Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
__Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
__Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
__Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
__Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
__Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
__Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
1;
Py_DECREF(inspect);
return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
return 0; // It's a limited API-only feature
}
#endif
/* MathInitCode */
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#endif
#include
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
float value;
memset(&value, 0xFF, sizeof(value));
return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
#ifdef CYTHON_EXTERN_C
#undef __PYX_EXTERN_C
#define __PYX_EXTERN_C CYTHON_EXTERN_C
#elif defined(__PYX_EXTERN_C)
#ifdef _MSC_VER
#pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
#else
#warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
#endif
#else
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#endif
#define __PYX_HAVE__pyreadstat___readstat_parser
#define __PYX_HAVE_API__pyreadstat___readstat_parser
/* Early includes */
#include
#include
#include
#include "readstat.h"
#include "readstat_io_unistd.h"
#include "conditional_includes.h"
#include
#include
#if CYTHON_COMPILING_IN_LIMITED_API
#ifdef _MSC_VER
#pragma message ("This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API.")
#else
#warning This module uses CPython specific internals of 'datetime.datetime', which are not available in the limited API.
#endif
#endif
#include "datetime.h"
#define __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold) PyDateTimeAPI->DateTime_FromDateAndTimeAndFold(year, month, day, hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->DateTimeType)
#define __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold) PyDateTimeAPI->Time_FromTimeAndFold(hour, minute, second, microsecond, tz, fold, PyDateTimeAPI->TimeType)
#define __Pyx_TimeZone_UTC PyDateTime_TimeZone_UTC
#define __Pyx_TimeZone_FromOffsetAndName(offset, name) PyTimeZone_FromOffsetAndName(offset, name)
/* Backport for Python < 3.10 */
#if PY_VERSION_HEX < 0x030a00a1
#ifndef PyDateTime_TIME_GET_TZINFO
#define PyDateTime_TIME_GET_TZINFO(o) ((((PyDateTime_Time*)o)->hastzinfo) ? ((PyDateTime_Time*)o)->tzinfo : Py_None)
#endif
#ifndef PyDateTime_DATE_GET_TZINFO
#define PyDateTime_DATE_GET_TZINFO(o) ((((PyDateTime_DateTime*)o)->hastzinfo) ? ((PyDateTime_DateTime*)o)->tzinfo : Py_None)
#endif
#endif
#include
#ifdef _OPENMP
#include
#endif /* _OPENMP */
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 1
#define __Pyx_PyObject_FromString __Pyx_PyUnicode_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
(sizeof(type) < sizeof(Py_ssize_t)) ||\
(sizeof(type) > sizeof(Py_ssize_t) &&\
likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX) &&\
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
v == (type)PY_SSIZE_T_MIN))) ||\
(sizeof(type) == sizeof(Py_ssize_t) &&\
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
#include
#define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
#define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
#define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
#define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
return Py_NewRef(obj);
#else
Py_INCREF(obj);
return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
return Py_XNewRef(obj);
#else
Py_XINCREF(obj);
return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
#if PY_VERSION_HEX >= 0x030C00A7
#ifndef _PyLong_SIGN_MASK
#define _PyLong_SIGN_MASK 3
#endif
#ifndef _PyLong_NON_SIZE_BITS
#define _PyLong_NON_SIZE_BITS 3
#endif
#define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
#define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
#define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
#define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
#define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
#define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
#define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
#define __Pyx_PyLong_SignedDigitCount(x)\
((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
#if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
#define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
#define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
#else
#define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
#define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
#endif
typedef Py_ssize_t __Pyx_compact_pylong;
typedef size_t __Pyx_compact_upylong;
#else
#define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
#define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
#define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
#define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
#define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
#define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
#define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
#define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
#define __Pyx_PyLong_CompactValue(x)\
((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
typedef sdigit __Pyx_compact_pylong;
typedef digit __Pyx_compact_upylong;
#endif
#if PY_VERSION_HEX >= 0x030C00A5
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
#else
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
#endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#endif
/* Test for GCC > 2.95 */
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
/* PretendToInitialize */
#ifdef __cplusplus
#if __cplusplus > 201103L
#include
#endif
template
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
if ((std::is_trivially_default_constructible::value))
#endif
*ptr = T();
(void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif
#if !CYTHON_USE_MODULE_STATE
static PyObject *__pyx_m = NULL;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * const __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;
/* #### Code section: filename_table ### */
static const char* const __pyx_f[] = {
"pyreadstat/_readstat_parser.pyx",
"",
"cpython/datetime.pxd",
"cpython/type.pxd",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto */
#include
#ifndef CYTHON_ATOMICS
#define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
(__STDC_VERSION__ >= 201112L) &&\
!defined(__STDC_NO_ATOMICS__))
#include
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
(__cplusplus >= 201103L) ||\
(defined(_MSC_VER) && _MSC_VER >= 1700)))
#include
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
(__STDC_VERSION__ >= 201112L) &&\
!defined(__STDC_NO_ATOMICS__) &&\
ATOMIC_INT_LOCK_FREE == 2)
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type atomic_int
#define __pyx_atomic_ptr_type atomic_uintptr_t
#define __pyx_nonatomic_ptr_type uintptr_t
#define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
#define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
#define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
#define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
#define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
#define __pyx_atomic_load(value) atomic_load(value)
#define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
#define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
#define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
#if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
#pragma message ("Using standard C atomics")
#elif defined(__PYX_DEBUG_ATOMICS)
#warning "Using standard C atomics"
#endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
(__cplusplus >= 201103L) ||\
\
(defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
ATOMIC_INT_LOCK_FREE == 2)
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type std::atomic_int
#define __pyx_atomic_ptr_type std::atomic_uintptr_t
#define __pyx_nonatomic_ptr_type uintptr_t
#define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
#define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
#define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
#define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
#define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
#define __pyx_atomic_load(value) std::atomic_load(value)
#define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
#define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
#define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
#if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
#pragma message ("Using standard C++ atomics")
#elif defined(__PYX_DEBUG_ATOMICS)
#warning "Using standard C++ atomics"
#endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
(__GNUC_MINOR__ > 1 ||\
(__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
#define __pyx_atomic_ptr_type void*
#define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
#define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
#define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
#define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
__pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
int result = old == *expected;
*expected = old;
return result;
}
#define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
#define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
#define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
#define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
#ifdef __PYX_DEBUG_ATOMICS
#warning "Using GNU atomics"
#endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
#include
#undef __pyx_atomic_int_type
#define __pyx_atomic_int_type long
#define __pyx_atomic_ptr_type void*
#undef __pyx_nonatomic_int_type
#define __pyx_nonatomic_int_type long
#pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
#define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
#define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
#define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
#define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
__pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
int result = old == *expected;
*expected = old;
return result;
}
#define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
#define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
#define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
#define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
#define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
#ifdef __PYX_DEBUG_ATOMICS
#pragma message ("Using MSVC atomics")
#endif
#else
#undef CYTHON_ATOMICS
#define CYTHON_ATOMICS 0
#ifdef __PYX_DEBUG_ATOMICS
#warning "Not using atomics"
#endif
#endif
#if CYTHON_ATOMICS
#define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
#define __pyx_sub_acquisition_count(memview)\
__pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
#else
#define __pyx_add_acquisition_count(memview)\
__pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
/* IncludeStructmemberH.proto */
#include
/* CriticalSections.proto */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs
#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs
#define __Pyx_PyCriticalSection_End1(cs)
#define __Pyx_PyCriticalSection_End2(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin
#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin
#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End
#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif
/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */
/*--- Type declarations ---*/
struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container;
struct __pyx_opt_args_7cpython_8datetime_time_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_new;
struct __pyx_opt_args_7cpython_8datetime_timezone_new;
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp;
/* "cpython/datetime.pxd":265
* # Create time object using DateTime CAPI factory function
* # Note, there are no range checks for any of the arguments.
* cdef inline time time_new(int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<<
* return __Pyx_DateTime_TimeWithFold(hour, minute, second, microsecond, tz, fold)
*
*/
struct __pyx_opt_args_7cpython_8datetime_time_new {
int __pyx_n;
int fold;
};
/* "cpython/datetime.pxd":270
* # Create datetime object using DateTime CAPI factory function.
* # Note, there are no range checks for any of the arguments.
* cdef inline datetime datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz, int fold=0): # <<<<<<<<<<<<<<
* return __Pyx_DateTime_DateTimeWithFold(year, month, day, hour, minute, second, microsecond, tz, fold)
*
*/
struct __pyx_opt_args_7cpython_8datetime_datetime_new {
int __pyx_n;
int fold;
};
/* "cpython/datetime.pxd":279
*
* # Create timedelta object using DateTime CAPI factory function.
* cdef inline object timezone_new(object offset, object name=None): # <<<<<<<<<<<<<<
* return __Pyx_TimeZone_FromOffsetAndName(offset, name if name is not None else NULL)
*
*/
struct __pyx_opt_args_7cpython_8datetime_timezone_new {
int __pyx_n;
PyObject *name;
};
/* "cpython/datetime.pxd":283
*
* # Create datetime object using DB API constructor.
* cdef inline datetime datetime_from_timestamp(timestamp, tz=None): # <<<<<<<<<<<<<<
* return PyDateTimeAPI.DateTime_FromTimestamp(
* PyDateTimeAPI.DateTimeType, (timestamp, tz) if tz is not None else (timestamp,), NULL)
*/
struct __pyx_opt_args_7cpython_8datetime_datetime_from_timestamp {
int __pyx_n;
PyObject *tz;
};
struct __pyx_opt_args_10pyreadstat_16_readstat_parser_run_readstat_parser;
/* "pyreadstat/_readstat_parser.pxd":22
*
* # Definitions of enum types
* ctypedef enum py_file_extension: # <<<<<<<<<<<<<<
* FILE_EXT_SAV
* FILE_EXT_SAS7BDAT
*/
enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension {
__pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAV,
__pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BDAT,
__pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_DTA,
__pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_XPORT,
__pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_POR,
__pyx_e_10pyreadstat_16_readstat_parser_FILE_EXT_SAS7BCAT
};
typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension;
/* "pyreadstat/_readstat_parser.pxd":30
* FILE_EXT_SAS7BCAT
*
* ctypedef enum py_file_format: # <<<<<<<<<<<<<<
* FILE_FORMAT_SAS
* FILE_FORMAT_SPSS
*/
enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_format {
__pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SAS,
__pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_SPSS,
__pyx_e_10pyreadstat_16_readstat_parser_FILE_FORMAT_STATA
};
typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_file_format __pyx_t_10pyreadstat_16_readstat_parser_py_file_format;
/* "pyreadstat/_readstat_parser.pxd":35
* FILE_FORMAT_STATA
*
* ctypedef enum py_datetime_format: # <<<<<<<<<<<<<<
* DATE_FORMAT_NOTADATE
* DATE_FORMAT_DATE
*/
enum __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format {
__pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_NOTADATE,
__pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATE,
__pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_DATETIME,
__pyx_e_10pyreadstat_16_readstat_parser_DATE_FORMAT_TIME
};
typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format;
/* "pyreadstat/_readstat_parser.pxd":41
* DATE_FORMAT_TIME
*
* ctypedef enum py_variable_format: # <<<<<<<<<<<<<<
* VAR_FORMAT_STRING
* VAR_FORMAT_LONG
*/
enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format {
__pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_STRING,
__pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_LONG,
__pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_FLOAT,
__pyx_e_10pyreadstat_16_readstat_parser_VAR_FORMAT_MISSING
};
typedef enum __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format __pyx_t_10pyreadstat_16_readstat_parser_py_variable_format;
/* "pyreadstat/_readstat_parser.pyx":929
*
*
* cdef void run_readstat_parser(char * filename, data_container data, py_file_extension file_extension, long row_limit, long row_offset, object file_obj=None) except *: # <<<<<<<<<<<<<<
* """
* Runs the parsing of the file by readstat library.
*/
struct __pyx_opt_args_10pyreadstat_16_readstat_parser_run_readstat_parser {
int __pyx_n;
PyObject *file_obj;
};
/* "pyreadstat/_readstat_parser.pxd":49
* # Definitions of extension types
*
* cdef class data_container: # <<<<<<<<<<<<<<
* """
* This extension type holds all the data we need to get from our file from
*/
struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container {
PyObject_HEAD
int n_obs;
int n_vars;
int max_n_obs;
PyObject *col_data;
PyObject *col_data_len;
PyObject *col_names;
PyObject *col_labels;
PyObject *col_dtypes;
PyObject *col_numpy_dtypes;
PyObject *col_dtypes_isobject;
PyObject *col_dytpes_isfloat;
PyObject *col_formats;
PyObject *col_formats_original;
PyObject *origin;
double unix_to_origin_secs;
__pyx_t_10pyreadstat_16_readstat_parser_py_file_format file_format;
int is_unkown_number_rows;
PyObject *file_label;
PyObject *file_encoding;
int metaonly;
int dates_as_pandas;
PyObject *label_to_var_name;
PyObject *labels_raw;
PyObject *notes;
PyObject *user_encoding;
PyObject *table_name;
int filter_cols;
PyObject *use_cols;
int usernan;
PyObject *missing_ranges;
PyObject *missing_user_values;
PyObject *variable_storage_width;
PyObject *variable_display_width;
PyObject *variable_alignment;
PyObject *variable_measure;
int no_datetime_conversion;
int ctime;
int mtime;
PyObject *mr_sets;
PyObject *output_format;
};
/* #### Code section: utility_code_proto ### */
/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
typedef struct {
void (*INCREF)(void*, PyObject*, Py_ssize_t);
void (*DECREF)(void*, PyObject*, Py_ssize_t);
void (*GOTREF)(void*, PyObject*, Py_ssize_t);
void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
void* (*SetupContext)(const char*, Py_ssize_t, const char*);
void (*FinishContext)(void**);
} __Pyx_RefNannyAPIStruct;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
if (acquire_gil) {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
PyGILState_Release(__pyx_gilstate_save);\
} else {\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
}
#define __Pyx_RefNannyFinishContextNogil() {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__Pyx_RefNannyFinishContext();\
PyGILState_Release(__pyx_gilstate_save);\
}
#define __Pyx_RefNannyFinishContextNogil() {\
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
__Pyx_RefNannyFinishContext();\
PyGILState_Release(__pyx_gilstate_save);\
}
#define __Pyx_RefNannyFinishContext()\
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
#define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
#define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
#define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
#define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
#define __Pyx_RefNannyDeclarations
#define __Pyx_RefNannySetupContext(name, acquire_gil)
#define __Pyx_RefNannyFinishContextNogil()
#define __Pyx_RefNannyFinishContext()
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XINCREF(r) Py_XINCREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_XGOTREF(r)
#define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; Py_XDECREF(tmp);\
} while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_XDECREF(tmp);\
} while (0)
#define __Pyx_DECREF_SET(r, v) do {\
PyObject *tmp = (PyObject *) r;\
r = v; __Pyx_DECREF(tmp);\
} while (0)
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
#endif
/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
#if PY_VERSION_HEX >= 0x030C00A6
#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
#else
#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
#endif
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
#endif
/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
#endif
/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif
/* IncludeStringH.proto */
#include
/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
#define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
#define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
#define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
#define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
#define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
#else
#define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
#endif
#else
#define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
#define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
#define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
#define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
#define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif
/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
/* RejectKeywords.proto */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);
/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
/* ParseKeywords.proto */
static CYTHON_INLINE int __Pyx_ParseKeywords(
PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
PyObject *kwds2, PyObject *values[],
Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
const char* function_name,
int ignore_unknown_kwargs
);
/* CallCFunction.proto */
#define __Pyx_CallCFunction(cfunc, self, args)\
((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
(sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
#if !CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03080000
#include "frameobject.h"
#define __Pxy_PyFrame_Initialize_Offsets()
#define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
#else
static size_t __pyx_pyframe_localsplus_offset = 0;
#include "frameobject.h"
#define __Pxy_PyFrame_Initialize_Offsets()\
((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
(void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
#define __Pyx_PyFrame_GetLocalsplus(frame)\
(assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif
#endif
#endif
/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);
/* UnpackUnboundCMethod.proto */
typedef struct {
PyObject *type;
PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
__pyx_atomic_int_type initialized;
#endif
PyCFunction func;
PyObject *method;
int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
return 1;
#else
__pyx_nonatomic_int_type expected = 0;
if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
return 0;
}
return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
__pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif
/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif
/* PyObjectDelAttr.proto */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif
/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
/* PySequenceContains.proto */
static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
int result = PySequence_Contains(seq, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* ModFloat[double].proto */
static CYTHON_INLINE double __Pyx_mod_double(double, double, int b_is_constant);
/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif
/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
(version_var) = __PYX_GET_DICT_VERSION(dict);\
(cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
(VAR) = __pyx_dict_cached_value;\
} else {\
(VAR) = __pyx_dict_cached_value = (LOOKUP);\
__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
}\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict) (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
#endif
/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name) do {\
static PY_UINT64_T __pyx_dict_version = 0;\
static PyObject *__pyx_dict_cached_value = NULL;\
(var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
(likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
__Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
#define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
PY_UINT64_T __pyx_dict_version;\
PyObject *__pyx_dict_cached_value;\
(var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
} while(0)
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif
/* RaiseUnboundLocalError.proto */
static void __Pyx_RaiseUnboundLocalError(const char *varname);
/* PyUnicode_Unicode.proto */
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Unicode(PyObject *obj);
/* PyObjectFormatAndDecref.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
Py_UCS4 max_char);
/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
Py_INCREF(x);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
L->ob_item[len] = x;
#else
PyList_SET_ITEM(list, len, x);
#endif
__Pyx_SET_SIZE(list, len + 1);
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
(likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))
/* UnicodeConcatInPlace.proto */
# if CYTHON_COMPILING_IN_CPYTHON
#if CYTHON_REFNANNY
#define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right, __pyx_refnanny)
#else
#define __Pyx_PyUnicode_ConcatInPlace(left, right) __Pyx_PyUnicode_ConcatInPlaceImpl(&left, right)
#endif
static CYTHON_INLINE PyObject *__Pyx_PyUnicode_ConcatInPlaceImpl(PyObject **p_left, PyObject *right
#if CYTHON_REFNANNY
, void* __pyx_refnanny
#endif
);
#else
#define __Pyx_PyUnicode_ConcatInPlace __Pyx_PyUnicode_Concat
#endif
#define __Pyx_PyUnicode_ConcatInPlaceSafe(left, right) ((unlikely((left) == Py_None) || unlikely((right) == Py_None)) ?\
PyNumber_InPlaceAdd(left, right) : __Pyx_PyUnicode_ConcatInPlace(left, right))
/* PyUnicodeContains.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) {
int result = PyUnicode_Contains(text, substring);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
/* DictGetItem.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
(likely(PyDict_CheckExact(obj)) ?\
__Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
#endif
/* SetItemInt.proto */
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
__Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
(is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
__Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list, int wraparound, int boundscheck);
/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif
/* PyObjectVectorCallMethodKwBuilder.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_VectorcallMethod_CallFromBuilder PyObject_VectorcallMethod
#else
static PyObject *__Pyx_Object_VectorcallMethod_CallFromBuilder(PyObject *name, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#endif
/* SliceObject.proto */
#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
__Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
/* CallUnboundCMethod1.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif
/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif
/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
#endif
/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
/* py_dict_keys.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);
/* CallUnboundCMethod0.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
#endif
/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
if (likely(L->allocated > len)) {
Py_INCREF(x);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
L->ob_item[len] = x;
#else
PyList_SET_ITEM(list, len, x);
#endif
__Pyx_SET_SIZE(list, len + 1);
return 0;
}
return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif
/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
#endif
/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
/* HasAttr.proto */
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
#else
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
#endif
/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif
/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
/* pyfrozenset_new.proto */
static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
/* PySetContains.proto */
static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);
/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
/* ImportDottedModuleRelFirst.proto */
static PyObject *__Pyx_ImportDottedModuleRelFirst(PyObject *name, PyObject *parts_tuple);
/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00a2
return PyList_Extend(L, v);
#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
PyObject* none = _PyList_Extend((PyListObject*)L, v);
if (unlikely(!none))
return -1;
Py_DECREF(none);
return 0;
#else
return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}
/* CallTypeTraverse.proto */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif
/* LimitedApiGetTypeDict.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif
/* SetItemOnTypeDict.proto */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
/* ValidateBasesTuple.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
#endif
/* PyType_Ready.proto */
CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
/* DelItemOnTypeDict.proto */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)
/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);
/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto_3_1_2
#define __PYX_HAVE_RT_ImportType_proto_3_1_2
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#include
#endif
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) alignof(s)
#else
#define __PYX_GET_STRUCT_ALIGNMENT_3_1_2(s) sizeof(void*)
#endif
enum __Pyx_ImportType_CheckSize_3_1_2 {
__Pyx_ImportType_CheckSize_Error_3_1_2 = 0,
__Pyx_ImportType_CheckSize_Warn_3_1_2 = 1,
__Pyx_ImportType_CheckSize_Ignore_3_1_2 = 2
};
static PyTypeObject *__Pyx_ImportType_3_1_2(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_1_2 check_size);
#endif
/* ListPack.proto */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);
/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
/* FetchSharedCythonModule.proto */
static PyObject *__Pyx_FetchSharedCythonABIModule(void);
/* dict_setdefault.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);
/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
/* CommonTypesMetaclass.proto */
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
#define __Pyx_CommonTypesMetaclass_USED
/* PyMethodNew.proto */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif
/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
#define __Pyx_CYFUNCTION_COROUTINE 0x08
#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
#define __Pyx_CyFunction_GetClassObj(f)\
((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
__Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject_HEAD
PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
PyCFunctionObject func;
#else
PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL ||\
(CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL)
__pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *func_weakreflist;
#endif
PyObject *func_dict;
PyObject *func_name;
PyObject *func_qualname;
PyObject *func_doc;
PyObject *func_globals;
PyObject *func_code;
PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
PyObject *func_classobj;
#endif
PyObject *defaults;
int flags;
PyObject *defaults_tuple;
PyObject *defaults_kwdict;
PyObject *(*defaults_getter)(PyObject *);
PyObject *func_annotations;
PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *closure,
PyObject *module, PyObject *globals,
PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
PyTypeObject *defaults_type);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif
/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
int flags, PyObject* qualname,
PyObject *closure,
PyObject *module, PyObject *globals,
PyObject* code);
/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
#define __Pyx_SetNameInClass(ns, name, value)\
(likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
(likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
#endif
/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif
/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
/* CLineInTraceback.proto */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#else
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#endif
/* CodeObjectCache.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
__Pyx_CachedCodeObjectType* code_object;
int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
int max_count;
__Pyx_CodeObjectCacheEntry* entries;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
__pyx_atomic_int_type accessor_count;
#endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
/* GCCDiagnostics.proto */
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_readstat_type_t(readstat_type_t value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value);
/* CIntFromPy.proto */
static CYTHON_INLINE readstat_type_t __Pyx_PyLong_As_readstat_type_t(PyObject *);
/* CIntFromPy.proto */
static CYTHON_INLINE __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __Pyx_PyLong_As___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_char(char value);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From___pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format(__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format value);
/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_off_t(off_t value);
/* CIntFromPy.proto */
static CYTHON_INLINE off_t __Pyx_PyLong_As_off_t(PyObject *);
/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif
/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
#define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
#define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif
/* GetRuntimeVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);
/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
/* VoidPtrExport.proto */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);
/* FunctionExport.proto */
static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif
/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
#if CYTHON_METH_FASTCALL
#define __PYX_FASTCALL_ABI_SUFFIX "_fastcall"
#else
#define __PYX_FASTCALL_ABI_SUFFIX
#endif
#define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
#define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
#define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
#define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
#define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
#define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
#define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
#define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
#define __PYX_FREELISTS_ABI_SUFFIX
#else
#define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_4time_6tzinfo_tzinfo(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4fold_fold(PyDateTime_Time *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4year_year(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_5month_month(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_3day_day(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4hour_hour(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6minute_minute(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_6second_second(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_11microsecond_microsecond(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_8datetime_6tzinfo_tzinfo(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_8datetime_4fold_fold(PyDateTime_DateTime *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_3day_day(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_6second_second(PyDateTime_Delta *__pyx_v_self); /* proto*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_9timedelta_11microsecond_microsecond(PyDateTime_Delta *__pyx_v_self); /* proto*/
/* Module declarations from "libc.stddef" */
/* Module declarations from "pyreadstat.readstat_api" */
/* Module declarations from "libc.string" */
/* Module declarations from "libc.stdio" */
/* Module declarations from "__builtin__" */
/* Module declarations from "cpython.type" */
/* Module declarations from "cpython" */
/* Module declarations from "cpython.object" */
/* Module declarations from "cpython.version" */
/* Module declarations from "datetime" */
/* Module declarations from "cpython.datetime" */
static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void); /*proto*/
static CYTHON_INLINE PyDateTime_DateTime *__pyx_f_7cpython_8datetime_datetime_new(int, int, int, int, int, int, int, PyObject *, struct __pyx_opt_args_7cpython_8datetime_datetime_new *__pyx_optional_args); /*proto*/
static CYTHON_INLINE PyDateTime_Delta *__pyx_f_7cpython_8datetime_timedelta_new(int, int, int); /*proto*/
static CYTHON_INLINE double __pyx_f_7cpython_8datetime_total_seconds(PyDateTime_Delta *); /*proto*/
/* Module declarations from "cpython.exc" */
/* Module declarations from "libc.math" */
/* Module declarations from "pyreadstat._readstat_parser" */
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_readstat_to_numpy_types = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_sas_date_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_sas_datetime_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_sas_time_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_sas_all_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_sas_origin = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_spss_datetime_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_spss_date_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_spss_time_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_spss_all_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_spss_origin = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_stata_datetime_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_stata_date_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_stata_time_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_stata_all_formats = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_stata_origin = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_unix_origin = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_sas_secs_from_unix = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_spss_secs_from_unix = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser_stata_secs_from_unix = 0;
static PyObject *__pyx_v_10pyreadstat_16_readstat_parser__file_object_ctx = 0;
static __pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format __pyx_f_10pyreadstat_16_readstat_parser_transform_variable_format(PyObject *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format); /*proto*/
static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_transform_datetime(__pyx_t_10pyreadstat_16_readstat_parser_py_datetime_format, double, __pyx_t_10pyreadstat_16_readstat_parser_py_file_format, PyObject *, int, PyObject *, double); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_handle_metadata(readstat_metadata_t *, void *); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_handle_variable(int, readstat_variable_t *, char *, void *); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value(int, readstat_variable_t *, readstat_value_t, void *); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_handle_value_label(char *, readstat_value_t, char *, void *); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_handle_note(int, char *, void *); /*proto*/
static void __pyx_f_10pyreadstat_16_readstat_parser_check_exit_status(readstat_error_t); /*proto*/
static void __pyx_f_10pyreadstat_16_readstat_parser_run_readstat_parser(char *, struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *, __pyx_t_10pyreadstat_16_readstat_parser_py_file_extension, long, long, struct __pyx_opt_args_10pyreadstat_16_readstat_parser_run_readstat_parser *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_to_dict(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/
static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_dict_to_dataframe(PyObject *, struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/
static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_data_container_extract_metadata(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/
static PyObject *__pyx_f_10pyreadstat_16_readstat_parser_convert_readstat_to_python_value(readstat_value_t, int, struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_handle_open(char const *, void *); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_open_handler(char const *, void *); /*proto*/
static int __pyx_f_10pyreadstat_16_readstat_parser_pyobject_close_handler(void *); /*proto*/
static Py_ssize_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_read_handler(void *, size_t, void *); /*proto*/
static readstat_off_t __pyx_f_10pyreadstat_16_readstat_parser_pyobject_seek_handler(readstat_off_t, readstat_io_flags_t, void *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "pyreadstat._readstat_parser"
extern int __pyx_module_is_main_pyreadstat___readstat_parser;
int __pyx_module_is_main_pyreadstat___readstat_parser = 0;
/* Implementation of "pyreadstat._readstat_parser" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_all;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_UnicodeError;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = "";
static const char __pyx_k_Q[] = "\200\001\330\004\n\210+\220Q";
static const char __pyx_k_d[] = "d";
static const char __pyx_k_s[] = "s";
static const char __pyx_k__2[] = "'";
static const char __pyx_k__3[] = ".";
static const char __pyx_k__4[] = "?";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_hi[] = "hi";
static const char __pyx_k_lo[] = "lo";
static const char __pyx_k_np[] = "np";
static const char __pyx_k_nt[] = "nt";
static const char __pyx_k_nw[] = "nw";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_tC[] = "%tC";
static const char __pyx_k_tc[] = "%tc";
static const char __pyx_k_td[] = "%td";
static const char __pyx_k_v2[] = "v2";
static const char __pyx_k_TOD[] = "TOD";
static const char __pyx_k_all[] = "all";
static const char __pyx_k_col[] = "col";
static const char __pyx_k_d_2[] = "%d";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_loc[] = "loc";
static const char __pyx_k_nan[] = "nan";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_DATE[] = "DATE";
static const char __pyx_k_HHMM[] = "HHMM";
static const char __pyx_k_None[] = "None";
static const char __pyx_k_TIME[] = "TIME";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_dict[] = "dict";
static const char __pyx_k_fill[] = "fill";
static const char __pyx_k_func[] = "__func__";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_int8[] = "int8";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_left[] = "left";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_read[] = "read";
static const char __pyx_k_seek[] = "seek";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_tell[] = "tell";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_warn[] = "warn";
static const char __pyx_k_ADATE[] = "ADATE";
static const char __pyx_k_DATE8[] = "DATE8";
static const char __pyx_k_DATE9[] = "DATE9";
static const char __pyx_k_DTIME[] = "DTIME";
static const char __pyx_k_EDATE[] = "EDATE";
static const char __pyx_k_JDATE[] = "JDATE";
static const char __pyx_k_M8_ns[] = "";
static const char __pyx_k_tdCCYY_NN_DD[] = "%tdCCYY-NN-DD";
static const char __pyx_k_undetermined[] = "undetermined";
static const char __pyx_k_value_labels[] = "value_labels";
static const char __pyx_k_with_columns[] = "with_columns";
static const char __pyx_k_ReadstatError[] = "ReadstatError";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_column_labels[] = "column_labels";
static const char __pyx_k_counted_value[] = "counted_value";
static const char __pyx_k_creation_time[] = "creation_time";
static const char __pyx_k_file_encoding[] = "file_encoding";
static const char __pyx_k_fromtimestamp[] = "fromtimestamp";
static const char __pyx_k_output_format[] = "output_format";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_variable_list[] = "variable_list";
static const char __pyx_k_data_container[] = "data_container";
static const char __pyx_k_missing_ranges[] = "missing_ranges";
static const char __pyx_k_number_columns[] = "number_columns";
static const char __pyx_k_PyreadstatError[] = "PyreadstatError";
static const char __pyx_k_allowed_formats[] = "allowed_formats";
static const char __pyx_k_sas_all_formats[] = "sas_all_formats";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_surrogateescape[] = "surrogateescape";
static const char __pyx_k_Unkown_data_type[] = "Unkown data type";
static const char __pyx_k_sas_date_formats[] = "sas_date_formats";
static const char __pyx_k_sas_time_formats[] = "sas_time_formats";
static const char __pyx_k_spss_all_formats[] = "spss_all_formats";
static const char __pyx_k_variable_measure[] = "variable_measure";
static const char __pyx_k_modification_time[] = "modification_time";
static const char __pyx_k_spss_date_formats[] = "spss_date_formats";
static const char __pyx_k_spss_time_formats[] = "spss_time_formats";
static const char __pyx_k_stata_all_formats[] = "stata_all_formats";
static const char __pyx_k_variable_to_label[] = "variable_to_label";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_metadata_container[] = "metadata_container";
static const char __pyx_k_narwhals_stable_v2[] = "narwhals.stable.v2";
static const char __pyx_k_stata_date_formats[] = "stata_date_formats";
static const char __pyx_k_stata_time_formats[] = "stata_time_formats";
static const char __pyx_k_variable_alignment[] = "variable_alignment";
static const char __pyx_k_Unknown_file_format[] = "Unknown file format";
static const char __pyx_k_missing_user_values[] = "missing_user_values";
static const char __pyx_k_get_native_namespace[] = "get_native_namespace";
static const char __pyx_k_sas_datetime_formats[] = "sas_datetime_formats";
static const char __pyx_k_File_0_does_not_exist[] = "File {0} does not exist!";
static const char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
static const char __pyx_k_spss_datetime_formats[] = "spss_datetime_formats";
static const char __pyx_k_variable_value_labels[] = "variable_value_labels";
static const char __pyx_k_STRING_type_with_value[] = "STRING type with value '";
static const char __pyx_k_column_names_to_labels[] = "column_names_to_labels";
static const char __pyx_k_stata_datetime_formats[] = "stata_datetime_formats";
static const char __pyx_k_variable_display_width[] = "variable_display_width";
static const char __pyx_k_variable_storage_width[] = "variable_storage_width";
static const char __pyx_k_original_variable_types[] = "original_variable_types";
static const char __pyx_k_readstat_to_numpy_types[] = "readstat_to_numpy_types";
static const char __pyx_k_readstat_variable_types[] = "readstat_variable_types";
static const char __pyx_k_with_date_type_in_column[] = "' with date type in column '";
static const char __pyx_k_metadata_container___init[] = "metadata_container.__init__";
static const char __pyx_k_pyreadstat__readstat_parser[] = "pyreadstat._readstat_parser";
static const char __pyx_k_A_Q_a_O1_Q_M_1_1_N_q_a_A_Q_O1[] = "\200A\330\010\014\320\014 \240\001\330\010\014\320\014!\240\021\330\010\014\320\014*\250!\330\010\014\320\014\035\230Q\330\010\014\320\014\036\230a\330\010\014\210O\2301\330\010\014\320\014)\250\021\330\010\014\320\014 \240\001\330\010\014\320\014%\240Q\330\010\014\210M\230\021\330\010\014\320\014+\2501\330\010\014\320\014+\2501\330\010\014\210N\230!\330\010\014\320\014\"\240!\330\010\014\320\014'\240q\330\010\014\320\014*\250!\330\010\014\320\014*\250!\330\010\014\320\014&\240a\330\010\014\320\014$\240A\330\010\014\320\014\035\230Q\330\010\014\320\014!\240\021\330\010\014\210O\2301";
static const char __pyx_k_data_container___reduce_cython[] = "data_container.__reduce_cython__";
static const char __pyx_k_Just_defining_a_custom_exceptio[] = "\n Just defining a custom exception to raise when readstat gives an error return code.\n ";
static const char __pyx_k_This_class_holds_metadata_we_wa[] = "\n This class holds metadata we want to give back to python\n ";
static const char __pyx_k_pyreadstat__readstat_parser_pyx[] = "pyreadstat/_readstat_parser.pyx";
static const char __pyx_k_Failed_convert_C_to_python_value[] = "Failed convert C to python value";
static const char __pyx_k_Failed_to_read_number_of_variabl[] = "Failed to read number of variables";
static const char __pyx_k_You_requested_pandas_as_output_f[] = "You requested pandas as output_format but cannot import pandas";
static const char __pyx_k_You_requested_polars_as_output_f[] = "You requested polars as output_format but cannot import polars";
static const char __pyx_k_column_0_is_duplicated_renamed_t[] = "column '{0}' is duplicated, renamed to '{1}'";
static const char __pyx_k_data_container___setstate_cython[] = "data_container.__setstate_cython__";
static const char __pyx_k_file_path_could_not_be_encoded_w[] = "file path could not be encoded with %s which is set as your system encoding, trying to encode it as utf-8. Please set your system encoding correctly.";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_output_format_must_be_one_of_all[] = "output format must be one of {allowed_formats}, '{output_format}' was given";
static const char __pyx_k_path_must_be_either_str_or_bytes[] = "path must be either str or bytes";
static const char __pyx_k_path_must_be_str_bytes_or_unicod[] = "path must be str, bytes or unicode";
static const char __pyx_k_Just_defining_a_custom_exceptio_2[] = "\n Just defining a custom exception to raise when pyreadstat raises an exception.\n ";
/* #### Code section: decls ### */
static int __pyx_pf_10pyreadstat_16_readstat_parser_14data_container___cinit__(struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_14data_container_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10pyreadstat_16_readstat_parser_data_container *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_10pyreadstat_16_readstat_parser_18metadata_container___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_10pyreadstat_16_readstat_parser_data_container(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
#define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
#define CYTHON_SMALL_CODE __attribute__((cold))
#else
#define CYTHON_SMALL_CODE
#endif
#endif
typedef struct {
PyObject *__pyx_d;
PyObject *__pyx_b;
PyObject *__pyx_cython_runtime;
PyObject *__pyx_empty_tuple;
PyObject *__pyx_empty_bytes;
PyObject *__pyx_empty_unicode;
#ifdef __Pyx_CyFunction_USED
PyTypeObject *__pyx_CyFunctionType;
#endif
#ifdef __Pyx_FusedFunction_USED
PyTypeObject *__pyx_FusedFunctionType;
#endif
#ifdef __Pyx_Generator_USED
PyTypeObject *__pyx_GeneratorType;
#endif
#ifdef __Pyx_IterableCoroutine_USED
PyTypeObject *__pyx_IterableCoroutineType;
#endif
#ifdef __Pyx_Coroutine_USED
PyTypeObject *__pyx_CoroutineAwaitType;
#endif
#ifdef __Pyx_Coroutine_USED
PyTypeObject *__pyx_CoroutineType;
#endif
PyTypeObject *__pyx_ptype_7cpython_4type_type;
PyTypeObject *__pyx_ptype_7cpython_8datetime_date;
PyTypeObject *__pyx_ptype_7cpython_8datetime_time;
PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime;
PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta;
PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo;
PyObject *__pyx_type_10pyreadstat_16_readstat_parser_data_container;
PyTypeObject *__pyx_ptype_10pyreadstat_16_readstat_parser_data_container;
__Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get;
__Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
__Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys;
__Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
PyObject *__pyx_slice[1];
PyObject *__pyx_tuple[2];
PyObject *__pyx_codeobj_tab[3];
PyObject *__pyx_string_tab[298];
PyObject *__pyx_int_0;
PyObject *__pyx_int_1;
PyObject *__pyx_int_100000;
/* #### Code section: module_state_contents ### */
/* CommonTypesMetaclass.module_state_decls */
PyTypeObject *__pyx_CommonTypesMetaclassType;
/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif
/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;
/* #### Code section: module_state_end ### */
} __pyx_mstatetype;
#if CYTHON_USE_MODULE_STATE
#ifdef __cplusplus
namespace {
extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif
#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
{};
#else
{0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_b_ __pyx_string_tab[0]
#define __pyx_kp_u_ __pyx_string_tab[1]
#define __pyx_n_u_ADATE __pyx_string_tab[2]
#define __pyx_n_u_ADATE10 __pyx_string_tab[3]
#define __pyx_n_u_ADATE8 __pyx_string_tab[4]
#define __pyx_n_u_B8601DA __pyx_string_tab[5]
#define __pyx_n_u_B8601DN __pyx_string_tab[6]
#define __pyx_n_u_B8601DT __pyx_string_tab[7]
#define __pyx_n_u_B8601TM __pyx_string_tab[8]
#define __pyx_n_u_DATE __pyx_string_tab[9]
#define __pyx_n_u_DATE11 __pyx_string_tab[10]
#define __pyx_n_u_DATE12 __pyx_string_tab[11]
#define __pyx_n_u_DATE8 __pyx_string_tab[12]
#define __pyx_n_u_DATE9 __pyx_string_tab[13]
#define __pyx_n_u_DATEAMPM __pyx_string_tab[14]
#define __pyx_n_u_DATETIME __pyx_string_tab[15]
#define __pyx_n_u_DATETIME17 __pyx_string_tab[16]
#define __pyx_n_u_DATETIME18 __pyx_string_tab[17]
#define __pyx_n_u_DATETIME19 __pyx_string_tab[18]
#define __pyx_n_u_DATETIME20 __pyx_string_tab[19]
#define __pyx_n_u_DATETIME21 __pyx_string_tab[20]
#define __pyx_n_u_DATETIME22 __pyx_string_tab[21]
#define __pyx_kp_u_DATETIME23_2 __pyx_string_tab[22]
#define __pyx_n_u_DATETIME8 __pyx_string_tab[23]
#define __pyx_n_u_DDMMYY __pyx_string_tab[24]
#define __pyx_n_u_DDMMYYB __pyx_string_tab[25]
#define __pyx_n_u_DDMMYYB10 __pyx_string_tab[26]
#define __pyx_n_u_DDMMYYC __pyx_string_tab[27]
#define __pyx_n_u_DDMMYYC10 __pyx_string_tab[28]
#define __pyx_n_u_DDMMYYD __pyx_string_tab[29]
#define __pyx_n_u_DDMMYYD10 __pyx_string_tab[30]
#define __pyx_n_u_DDMMYYN6 __pyx_string_tab[31]
#define __pyx_n_u_DDMMYYN8 __pyx_string_tab[32]
#define __pyx_n_u_DDMMYYP __pyx_string_tab[33]
#define __pyx_n_u_DDMMYYP10 __pyx_string_tab[34]
#define __pyx_n_u_DDMMYYS __pyx_string_tab[35]
#define __pyx_n_u_DDMMYYS10 __pyx_string_tab[36]
#define __pyx_n_u_DTDATE __pyx_string_tab[37]
#define __pyx_n_u_DTIME __pyx_string_tab[38]
#define __pyx_n_u_E8601DA __pyx_string_tab[39]
#define __pyx_n_u_E8601DT __pyx_string_tab[40]
#define __pyx_n_u_E8601TM __pyx_string_tab[41]
#define __pyx_n_u_EDATE __pyx_string_tab[42]
#define __pyx_n_u_EDATE10 __pyx_string_tab[43]
#define __pyx_n_u_EDATE8 __pyx_string_tab[44]
#define __pyx_kp_u_Failed_convert_C_to_python_value __pyx_string_tab[45]
#define __pyx_kp_u_Failed_to_read_number_of_variabl __pyx_string_tab[46]
#define __pyx_kp_u_File_0_does_not_exist __pyx_string_tab[47]
#define __pyx_n_u_HHMM __pyx_string_tab[48]
#define __pyx_n_u_IS8601DA __pyx_string_tab[49]
#define __pyx_n_u_IS8601DT __pyx_string_tab[50]
#define __pyx_n_u_IS8601TM __pyx_string_tab[51]
#define __pyx_n_u_JDATE __pyx_string_tab[52]
#define __pyx_n_u_JDATE5 __pyx_string_tab[53]
#define __pyx_n_u_JDATE7 __pyx_string_tab[54]
#define __pyx_kp_u_Just_defining_a_custom_exceptio __pyx_string_tab[55]
#define __pyx_kp_u_Just_defining_a_custom_exceptio_2 __pyx_string_tab[56]
#define __pyx_kp_u_M8_ns __pyx_string_tab[57]
#define __pyx_n_u_MDYAMPM __pyx_string_tab[58]
#define __pyx_n_u_MMDDYY __pyx_string_tab[59]
#define __pyx_n_u_MMDDYYB __pyx_string_tab[60]
#define __pyx_n_u_MMDDYYB10 __pyx_string_tab[61]
#define __pyx_n_u_MMDDYYC __pyx_string_tab[62]
#define __pyx_n_u_MMDDYYC10 __pyx_string_tab[63]
#define __pyx_n_u_MMDDYYD __pyx_string_tab[64]
#define __pyx_n_u_MMDDYYD10 __pyx_string_tab[65]
#define __pyx_n_u_MMDDYYN6 __pyx_string_tab[66]
#define __pyx_n_u_MMDDYYN8 __pyx_string_tab[67]
#define __pyx_n_u_MMDDYYP __pyx_string_tab[68]
#define __pyx_n_u_MMDDYYP10 __pyx_string_tab[69]
#define __pyx_n_u_MMDDYYS __pyx_string_tab[70]
#define __pyx_n_u_MMDDYYS10 __pyx_string_tab[71]
#define __pyx_kp_u_None __pyx_string_tab[72]
#define __pyx_n_u_Object __pyx_string_tab[73]
#define __pyx_n_u_OrderedDict __pyx_string_tab[74]
#define __pyx_n_u_PyreadstatError __pyx_string_tab[75]
#define __pyx_n_u_ReadstatError __pyx_string_tab[76]
#define __pyx_n_u_SDATE __pyx_string_tab[77]
#define __pyx_n_u_SDATE10 __pyx_string_tab[78]
#define __pyx_n_u_SDATE8 __pyx_string_tab[79]
#define __pyx_kp_u_STRING_type_with_value __pyx_string_tab[80]
#define __pyx_n_u_TIME __pyx_string_tab[81]
#define __pyx_kp_u_TIME11_2 __pyx_string_tab[82]
#define __pyx_n_u_TIME20 __pyx_string_tab[83]
#define __pyx_kp_u_TIME20_3 __pyx_string_tab[84]
#define __pyx_n_u_TIME5 __pyx_string_tab[85]
#define __pyx_n_u_TIME8 __pyx_string_tab[86]
#define __pyx_n_u_TIMEAMPM __pyx_string_tab[87]
#define __pyx_n_u_TOD __pyx_string_tab[88]
#define __pyx_kp_u_This_class_holds_metadata_we_wa __pyx_string_tab[89]
#define __pyx_n_u_TypeError __pyx_string_tab[90]
#define __pyx_n_u_UnicodeError __pyx_string_tab[91]
#define __pyx_kp_u_Unknown_file_format __pyx_string_tab[92]
#define __pyx_kp_u_Unkown_data_type __pyx_string_tab[93]
#define __pyx_n_u_WEEKDATE __pyx_string_tab[94]
#define __pyx_n_u_WEEKDATX __pyx_string_tab[95]
#define __pyx_n_u_YMDHMS16 __pyx_string_tab[96]
#define __pyx_n_u_YMDHMS19 __pyx_string_tab[97]
#define __pyx_kp_u_YMDHMS19_2 __pyx_string_tab[98]
#define __pyx_n_u_YMDHMS20 __pyx_string_tab[99]
#define __pyx_n_u_YYMMDD __pyx_string_tab[100]
#define __pyx_n_u_YYMMDD10 __pyx_string_tab[101]
#define __pyx_n_u_YYMMDDB __pyx_string_tab[102]
#define __pyx_n_u_YYMMDDD __pyx_string_tab[103]
#define __pyx_n_u_YYMMDDN __pyx_string_tab[104]
#define __pyx_n_u_YYMMDDP __pyx_string_tab[105]
#define __pyx_n_u_YYMMDDS __pyx_string_tab[106]
#define __pyx_kp_u_You_requested_pandas_as_output_f __pyx_string_tab[107]
#define __pyx_kp_u_You_requested_polars_as_output_f __pyx_string_tab[108]
#define __pyx_kp_u__2 __pyx_string_tab[109]
#define __pyx_kp_u__3 __pyx_string_tab[110]
#define __pyx_kp_u__4 __pyx_string_tab[111]
#define __pyx_n_u_all __pyx_string_tab[112]
#define __pyx_n_u_allowed_formats __pyx_string_tab[113]
#define __pyx_n_u_append __pyx_string_tab[114]
#define __pyx_n_u_astype __pyx_string_tab[115]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[116]
#define __pyx_n_u_backend __pyx_string_tab[117]
#define __pyx_n_u_center __pyx_string_tab[118]
#define __pyx_n_u_class_getitem __pyx_string_tab[119]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[120]
#define __pyx_n_u_col __pyx_string_tab[121]
#define __pyx_n_u_collections __pyx_string_tab[122]
#define __pyx_kp_u_column_0_is_duplicated_renamed_t __pyx_string_tab[123]
#define __pyx_n_u_column_labels __pyx_string_tab[124]
#define __pyx_n_u_column_names __pyx_string_tab[125]
#define __pyx_n_u_column_names_to_labels __pyx_string_tab[126]
#define __pyx_n_u_columns __pyx_string_tab[127]
#define __pyx_n_u_copy __pyx_string_tab[128]
#define __pyx_n_u_counted_value __pyx_string_tab[129]
#define __pyx_n_u_creation_time __pyx_string_tab[130]
#define __pyx_n_u_d __pyx_string_tab[131]
#define __pyx_kp_u_d_2 __pyx_string_tab[132]
#define __pyx_n_u_data_container __pyx_string_tab[133]
#define __pyx_n_u_data_container___reduce_cython __pyx_string_tab[134]
#define __pyx_n_u_data_container___setstate_cython __pyx_string_tab[135]
#define __pyx_n_u_date __pyx_string_tab[136]
#define __pyx_n_u_datetime __pyx_string_tab[137]
#define __pyx_n_u_dict __pyx_string_tab[138]
#define __pyx_kp_u_disable __pyx_string_tab[139]
#define __pyx_n_u_doc __pyx_string_tab[140]
#define __pyx_n_u_double __pyx_string_tab[141]
#define __pyx_n_u_dtype __pyx_string_tab[142]
#define __pyx_n_u_dtypes __pyx_string_tab[143]
#define __pyx_n_u_duplicated __pyx_string_tab[144]
#define __pyx_n_u_empty __pyx_string_tab[145]
#define __pyx_kp_u_enable __pyx_string_tab[146]
#define __pyx_n_u_encode __pyx_string_tab[147]
#define __pyx_n_u_enumerate __pyx_string_tab[148]
#define __pyx_n_u_expanduser __pyx_string_tab[149]
#define __pyx_n_u_extend __pyx_string_tab[150]
#define __pyx_n_u_file_encoding __pyx_string_tab[151]
#define __pyx_n_u_file_label __pyx_string_tab[152]
#define __pyx_kp_u_file_path_could_not_be_encoded_w __pyx_string_tab[153]
#define __pyx_n_u_fill __pyx_string_tab[154]
#define __pyx_n_u_float __pyx_string_tab[155]
#define __pyx_n_u_float64 __pyx_string_tab[156]
#define __pyx_n_u_format __pyx_string_tab[157]
#define __pyx_n_u_from_dict __pyx_string_tab[158]
#define __pyx_n_u_from_epoch __pyx_string_tab[159]
#define __pyx_n_u_fromtimestamp __pyx_string_tab[160]
#define __pyx_n_u_fsdecode __pyx_string_tab[161]
#define __pyx_n_u_fsencode __pyx_string_tab[162]
#define __pyx_n_u_func __pyx_string_tab[163]
#define __pyx_kp_u_gc __pyx_string_tab[164]
#define __pyx_n_u_get __pyx_string_tab[165]
#define __pyx_n_u_get_native_namespace __pyx_string_tab[166]
#define __pyx_n_u_getfilesystemencoding __pyx_string_tab[167]
#define __pyx_n_u_getstate __pyx_string_tab[168]
#define __pyx_n_u_hi __pyx_string_tab[169]
#define __pyx_n_u_init __pyx_string_tab[170]
#define __pyx_n_u_initializing __pyx_string_tab[171]
#define __pyx_n_u_int16 __pyx_string_tab[172]
#define __pyx_n_u_int32 __pyx_string_tab[173]
#define __pyx_n_u_int64 __pyx_string_tab[174]
#define __pyx_n_u_int8 __pyx_string_tab[175]
#define __pyx_n_u_is_coroutine __pyx_string_tab[176]
#define __pyx_n_u_is_dichotomy __pyx_string_tab[177]
#define __pyx_kp_u_isenabled __pyx_string_tab[178]
#define __pyx_n_u_isfile __pyx_string_tab[179]
#define __pyx_n_u_items __pyx_string_tab[180]
#define __pyx_n_u_keys __pyx_string_tab[181]
#define __pyx_n_u_label __pyx_string_tab[182]
#define __pyx_n_u_left __pyx_string_tab[183]
#define __pyx_n_u_lo __pyx_string_tab[184]
#define __pyx_n_u_loc __pyx_string_tab[185]
#define __pyx_n_u_main __pyx_string_tab[186]
#define __pyx_n_u_metaclass __pyx_string_tab[187]
#define __pyx_n_u_metadata_container __pyx_string_tab[188]
#define __pyx_n_u_metadata_container___init __pyx_string_tab[189]
#define __pyx_n_u_missing_ranges __pyx_string_tab[190]
#define __pyx_n_u_missing_user_values __pyx_string_tab[191]
#define __pyx_n_u_modification_time __pyx_string_tab[192]
#define __pyx_n_u_module __pyx_string_tab[193]
#define __pyx_n_u_mr_sets __pyx_string_tab[194]
#define __pyx_n_u_mro_entries __pyx_string_tab[195]
#define __pyx_n_u_name __pyx_string_tab[196]
#define __pyx_n_u_name_2 __pyx_string_tab[197]
#define __pyx_n_u_nan __pyx_string_tab[198]
#define __pyx_n_u_narwhals __pyx_string_tab[199]
#define __pyx_n_u_narwhals_stable_v2 __pyx_string_tab[200]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[201]
#define __pyx_n_u_nominal __pyx_string_tab[202]
#define __pyx_n_u_notes __pyx_string_tab[203]
#define __pyx_n_u_np __pyx_string_tab[204]
#define __pyx_n_u_nt __pyx_string_tab[205]
#define __pyx_n_u_number_columns __pyx_string_tab[206]
#define __pyx_n_u_number_rows __pyx_string_tab[207]
#define __pyx_n_u_numpy __pyx_string_tab[208]
#define __pyx_n_u_nw __pyx_string_tab[209]
#define __pyx_n_u_object __pyx_string_tab[210]
#define __pyx_n_u_ordinal __pyx_string_tab[211]
#define __pyx_n_u_original_variable_types __pyx_string_tab[212]
#define __pyx_n_u_os __pyx_string_tab[213]
#define __pyx_n_u_output_format __pyx_string_tab[214]
#define __pyx_kp_u_output_format_must_be_one_of_all __pyx_string_tab[215]
#define __pyx_n_u_pandas __pyx_string_tab[216]
#define __pyx_n_u_path __pyx_string_tab[217]
#define __pyx_kp_u_path_must_be_either_str_or_bytes __pyx_string_tab[218]
#define __pyx_kp_u_path_must_be_str_bytes_or_unicod __pyx_string_tab[219]
#define __pyx_n_u_polars __pyx_string_tab[220]
#define __pyx_n_u_pop __pyx_string_tab[221]
#define __pyx_n_u_prepare __pyx_string_tab[222]
#define __pyx_n_u_pyreadstat__readstat_parser __pyx_string_tab[223]
#define __pyx_kp_u_pyreadstat__readstat_parser_pyx __pyx_string_tab[224]
#define __pyx_n_u_pyx_capi __pyx_string_tab[225]
#define __pyx_n_u_pyx_state __pyx_string_tab[226]
#define __pyx_n_u_qualname __pyx_string_tab[227]
#define __pyx_n_u_range __pyx_string_tab[228]
#define __pyx_n_u_read __pyx_string_tab[229]
#define __pyx_n_u_readstat_to_numpy_types __pyx_string_tab[230]
#define __pyx_n_u_readstat_variable_types __pyx_string_tab[231]
#define __pyx_n_u_reduce __pyx_string_tab[232]
#define __pyx_n_u_reduce_cython __pyx_string_tab[233]
#define __pyx_n_u_reduce_ex __pyx_string_tab[234]
#define __pyx_n_u_right __pyx_string_tab[235]
#define __pyx_n_u_s __pyx_string_tab[236]
#define __pyx_n_u_sas_all_formats __pyx_string_tab[237]
#define __pyx_n_u_sas_date_formats __pyx_string_tab[238]
#define __pyx_n_u_sas_datetime_formats __pyx_string_tab[239]
#define __pyx_n_u_sas_origin __pyx_string_tab[240]
#define __pyx_n_u_sas_time_formats __pyx_string_tab[241]
#define __pyx_n_u_scale __pyx_string_tab[242]
#define __pyx_n_u_schema __pyx_string_tab[243]
#define __pyx_n_u_seek __pyx_string_tab[244]
#define __pyx_n_u_self __pyx_string_tab[245]
#define __pyx_n_u_set_name __pyx_string_tab[246]
#define __pyx_n_u_setstate __pyx_string_tab[247]
#define __pyx_n_u_setstate_cython __pyx_string_tab[248]
#define __pyx_n_u_spec __pyx_string_tab[249]
#define __pyx_n_u_spss_all_formats __pyx_string_tab[250]
#define __pyx_n_u_spss_date_formats __pyx_string_tab[251]
#define __pyx_n_u_spss_datetime_formats __pyx_string_tab[252]
#define __pyx_n_u_spss_origin __pyx_string_tab[253]
#define __pyx_n_u_spss_time_formats __pyx_string_tab[254]
#define __pyx_n_u_stable __pyx_string_tab[255]
#define __pyx_n_u_stata_all_formats __pyx_string_tab[256]
#define __pyx_n_u_stata_date_formats __pyx_string_tab[257]
#define __pyx_n_u_stata_datetime_formats __pyx_string_tab[258]
#define __pyx_n_u_stata_origin __pyx_string_tab[259]
#define __pyx_n_u_stata_time_formats __pyx_string_tab[260]
#define __pyx_n_u_string __pyx_string_tab[261]
#define __pyx_kp_u_stringsource __pyx_string_tab[262]
#define __pyx_n_u_surrogateescape __pyx_string_tab[263]
#define __pyx_n_u_sys __pyx_string_tab[264]
#define __pyx_kp_u_tC __pyx_string_tab[265]
#define __pyx_n_u_table_name __pyx_string_tab[266]
#define __pyx_kp_u_tc __pyx_string_tab[267]
#define __pyx_kp_u_tcHH_MM __pyx_string_tab[268]
#define __pyx_kp_u_tcHH_MM_SS __pyx_string_tab[269]
#define __pyx_kp_u_td __pyx_string_tab[270]
#define __pyx_kp_u_tdCCYY_NN_DD __pyx_string_tab[271]
#define __pyx_kp_u_tdD_m_Y __pyx_string_tab[272]
#define __pyx_n_u_tell __pyx_string_tab[273]
#define __pyx_n_u_test __pyx_string_tab[274]
#define __pyx_n_u_time __pyx_string_tab[275]
#define __pyx_n_u_time_unit __pyx_string_tab[276]
#define __pyx_n_u_to_datetime __pyx_string_tab[277]
#define __pyx_n_u_to_native __pyx_string_tab[278]
#define __pyx_n_u_tolist __pyx_string_tab[279]
#define __pyx_n_u_type __pyx_string_tab[280]
#define __pyx_n_u_undetermined __pyx_string_tab[281]
#define __pyx_n_u_unknown __pyx_string_tab[282]
#define __pyx_kp_u_utf_8 __pyx_string_tab[283]
#define __pyx_n_u_v2 __pyx_string_tab[284]
#define __pyx_n_u_value_labels __pyx_string_tab[285]
#define __pyx_n_u_variable_alignment __pyx_string_tab[286]
#define __pyx_n_u_variable_display_width __pyx_string_tab[287]
#define __pyx_n_u_variable_list __pyx_string_tab[288]
#define __pyx_n_u_variable_measure __pyx_string_tab[289]
#define __pyx_n_u_variable_storage_width __pyx_string_tab[290]
#define __pyx_n_u_variable_to_label __pyx_string_tab[291]
#define __pyx_n_u_variable_value_labels __pyx_string_tab[292]
#define __pyx_n_u_warn __pyx_string_tab[293]
#define __pyx_n_u_warnings __pyx_string_tab[294]
#define __pyx_n_u_with_columns __pyx_string_tab[295]
#define __pyx_kp_u_with_date_type_in_column __pyx_string_tab[296]
#define __pyx_n_u_zip __pyx_string_tab[297]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
__pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
if (!clear_module_state) return 0;
Py_CLEAR(clear_module_state->__pyx_d);
Py_CLEAR(clear_module_state->__pyx_b);
Py_CLEAR(clear_module_state->__pyx_cython_runtime);
Py_CLEAR(clear_module_state->__pyx_empty_tuple);
Py_CLEAR(clear_module_state->__pyx_empty_bytes);
Py_CLEAR(clear_module_state->__pyx_empty_unicode);
#ifdef __Pyx_CyFunction_USED
Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
#endif
#ifdef __Pyx_FusedFunction_USED
Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
#endif
#if CYTHON_PEP489_MULTI_PHASE_INIT
__Pyx_State_RemoveModule(NULL);
#endif
Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_date);
Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_time);
Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_datetime);
Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
Py_CLEAR(clear_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container);
Py_CLEAR(clear_module_state->__pyx_type_10pyreadstat_16_readstat_parser_data_container);
for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
for (int i=0; i<298; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
Py_CLEAR(clear_module_state->__pyx_int_0);
Py_CLEAR(clear_module_state->__pyx_int_1);
Py_CLEAR(clear_module_state->__pyx_int_100000);
return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
__pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
if (!traverse_module_state) return 0;
Py_VISIT(traverse_module_state->__pyx_d);
Py_VISIT(traverse_module_state->__pyx_b);
Py_VISIT(traverse_module_state->__pyx_cython_runtime);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
#ifdef __Pyx_CyFunction_USED
Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
#endif
#ifdef __Pyx_FusedFunction_USED
Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
#endif
Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_date);
Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_time);
Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_datetime);
Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_timedelta);
Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_8datetime_tzinfo);
Py_VISIT(traverse_module_state->__pyx_ptype_10pyreadstat_16_readstat_parser_data_container);
Py_VISIT(traverse_module_state->__pyx_type_10pyreadstat_16_readstat_parser_data_container);
for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
for (int i=0; i<298; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
__Pyx_VISIT_CONST(traverse_module_state->__pyx_int_100000);
return 0;
}
#endif
/* #### Code section: module_code ### */
/* "cpython/datetime.pxd":44
*
* ctypedef extern class datetime.date[object PyDateTime_Date]:
* @property # <<<<<<<<<<<<<<
* cdef inline int year(self) noexcept:
* return PyDateTime_GET_YEAR(self)
*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_4year_year(PyDateTime_Date *__pyx_v_self) {
int __pyx_r;
/* "cpython/datetime.pxd":46
* @property
* cdef inline int year(self) noexcept:
* return PyDateTime_GET_YEAR(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDateTime_GET_YEAR(((PyObject *)__pyx_v_self));
goto __pyx_L0;
/* "cpython/datetime.pxd":44
*
* ctypedef extern class datetime.date[object PyDateTime_Date]:
* @property # <<<<<<<<<<<<<<
* cdef inline int year(self) noexcept:
* return PyDateTime_GET_YEAR(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "cpython/datetime.pxd":48
* return PyDateTime_GET_YEAR(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int month(self) noexcept:
* return PyDateTime_GET_MONTH(self)
*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_5month_month(PyDateTime_Date *__pyx_v_self) {
int __pyx_r;
/* "cpython/datetime.pxd":50
* @property
* cdef inline int month(self) noexcept:
* return PyDateTime_GET_MONTH(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDateTime_GET_MONTH(((PyObject *)__pyx_v_self));
goto __pyx_L0;
/* "cpython/datetime.pxd":48
* return PyDateTime_GET_YEAR(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int month(self) noexcept:
* return PyDateTime_GET_MONTH(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "cpython/datetime.pxd":52
* return PyDateTime_GET_MONTH(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int day(self) noexcept:
* return PyDateTime_GET_DAY(self)
*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4date_3day_day(PyDateTime_Date *__pyx_v_self) {
int __pyx_r;
/* "cpython/datetime.pxd":54
* @property
* cdef inline int day(self) noexcept:
* return PyDateTime_GET_DAY(self) # <<<<<<<<<<<<<<
*
* ctypedef extern class datetime.time[object PyDateTime_Time]:
*/
__pyx_r = PyDateTime_GET_DAY(((PyObject *)__pyx_v_self));
goto __pyx_L0;
/* "cpython/datetime.pxd":52
* return PyDateTime_GET_MONTH(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int day(self) noexcept:
* return PyDateTime_GET_DAY(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "cpython/datetime.pxd":57
*
* ctypedef extern class datetime.time[object PyDateTime_Time]:
* @property # <<<<<<<<<<<<<<
* cdef inline int hour(self) noexcept:
* return PyDateTime_TIME_GET_HOUR(self)
*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_4hour_hour(PyDateTime_Time *__pyx_v_self) {
int __pyx_r;
/* "cpython/datetime.pxd":59
* @property
* cdef inline int hour(self) noexcept:
* return PyDateTime_TIME_GET_HOUR(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDateTime_TIME_GET_HOUR(((PyObject *)__pyx_v_self));
goto __pyx_L0;
/* "cpython/datetime.pxd":57
*
* ctypedef extern class datetime.time[object PyDateTime_Time]:
* @property # <<<<<<<<<<<<<<
* cdef inline int hour(self) noexcept:
* return PyDateTime_TIME_GET_HOUR(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "cpython/datetime.pxd":61
* return PyDateTime_TIME_GET_HOUR(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int minute(self) noexcept:
* return PyDateTime_TIME_GET_MINUTE(self)
*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6minute_minute(PyDateTime_Time *__pyx_v_self) {
int __pyx_r;
/* "cpython/datetime.pxd":63
* @property
* cdef inline int minute(self) noexcept:
* return PyDateTime_TIME_GET_MINUTE(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDateTime_TIME_GET_MINUTE(((PyObject *)__pyx_v_self));
goto __pyx_L0;
/* "cpython/datetime.pxd":61
* return PyDateTime_TIME_GET_HOUR(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int minute(self) noexcept:
* return PyDateTime_TIME_GET_MINUTE(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "cpython/datetime.pxd":65
* return PyDateTime_TIME_GET_MINUTE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int second(self) noexcept:
* return PyDateTime_TIME_GET_SECOND(self)
*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_6second_second(PyDateTime_Time *__pyx_v_self) {
int __pyx_r;
/* "cpython/datetime.pxd":67
* @property
* cdef inline int second(self) noexcept:
* return PyDateTime_TIME_GET_SECOND(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDateTime_TIME_GET_SECOND(((PyObject *)__pyx_v_self));
goto __pyx_L0;
/* "cpython/datetime.pxd":65
* return PyDateTime_TIME_GET_MINUTE(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int second(self) noexcept:
* return PyDateTime_TIME_GET_SECOND(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "cpython/datetime.pxd":69
* return PyDateTime_TIME_GET_SECOND(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int microsecond(self) noexcept:
* return PyDateTime_TIME_GET_MICROSECOND(self)
*/
static CYTHON_INLINE int __pyx_f_7cpython_8datetime_4time_11microsecond_microsecond(PyDateTime_Time *__pyx_v_self) {
int __pyx_r;
/* "cpython/datetime.pxd":71
* @property
* cdef inline int microsecond(self) noexcept:
* return PyDateTime_TIME_GET_MICROSECOND(self) # <<<<<<<<<<<<<<
*
* @property
*/
__pyx_r = PyDateTime_TIME_GET_MICROSECOND(((PyObject *)__pyx_v_self));
goto __pyx_L0;
/* "cpython/datetime.pxd":69
* return PyDateTime_TIME_GET_SECOND(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline int microsecond(self) noexcept:
* return PyDateTime_TIME_GET_MICROSECOND(self)
*/
/* function exit code */
__pyx_L0:;
return __pyx_r;
}
/* "cpython/datetime.pxd":73
* return PyDateTime_TIME_GET_MICROSECOND(self)
*
* @property # <<<<<<<<<<<<<<
* cdef inline object tzinfo(self):
* return